---
id: block-unsafe-code-execution
track: coding
version: 0.1.1
label: blocks
keyword: block
where: write turn-end
sha256: 60d4615a014eb1a7610ae904f64f60af24687385c5f2655768c4959898b48f9c
source: https://github.com/open-coder-ai/chock-catalog/tree/1e60d211c1bb767152c6ab0167932da06ab3a10f/agentic-security/block-unsafe-code-execution
catalog_ref: 1e60d211c1bb767152c6ab0167932da06ab3a10f
---

# Block Unsafe Code Execution

block-unsafe-code-execution · version 0.1.1

Blocks — Blocks on an agent's file writes and at turn end. Chock adds friction. It is not a security boundary. 

In a git repo: at commit (Chock refuses the commit, locally and in CI.)



## What it does

Commit and agent-write gate, greppable slice of ASI05: bare, global-receiver and indirect eval/exec forms, the Function constructor, string timers, exec-mode compile, import by computed name, shell-mode and implicit-shell process APIs, unsafe deserializers (pickle family, unsafe yaml loaders, model loads) and shell eval of a variable. File-type-blind line scan: friction, not a security boundary. Waiver 'pragma: allowlist exec' on the line; in the agent only if already committed in HEAD.

## Its label on each agent

- Claude Code (tested): Blocks — Blocks on an agent's file writes and at turn end. Builder: /coding/builder/#client=claude-code&p=block-unsafe-code-execution
- Cursor (tested): Blocks — Blocks on an agent's file writes and at turn end. Builder: /coding/builder/#client=cursor&p=block-unsafe-code-execution
- Codex (tested): Blocks — Blocks on an agent's file writes and at turn end. If the hook errors, the action goes through (not witnessed; the vendor's row is only partly live-run). Builder: /coding/builder/#client=codex&p=block-unsafe-code-execution
- GitHub Copilot (tested): Blocks — Blocks at turn end only. It does not check a file write when it happens. If the hook errors, the action goes through (not witnessed; the vendor's row is only partly live-run). Builder: /coding/builder/#client=copilot&p=block-unsafe-code-execution
- Devin (tested): Blocks — Blocks at turn end only. It does not check a file write when it happens. If the hook errors, the action goes through (vendor docs only, not witnessed). Builder: /coding/builder/#client=devin&p=block-unsafe-code-execution
- Grok (tested): Not graded yet for Grok. Builder: /coding/builder/#client=grok&p=block-unsafe-code-execution
- goose (tested): Not graded yet for goose. Builder: /coding/builder/#client=goose&p=block-unsafe-code-execution
- Antigravity (tested): Not graded yet for Antigravity. Builder: /coding/builder/#client=antigravity&p=block-unsafe-code-execution
- OpenHands (untested): Not graded yet for OpenHands. Builder: /coding/builder/#client=openhands&p=block-unsafe-code-execution
- Kimi Code (untested): Not graded yet for Kimi Code. Builder: /coding/builder/#client=kimi-code&p=block-unsafe-code-execution
- Factory Droid (untested): Not graded yet for Factory Droid. Builder: /coding/builder/#client=factory-droid&p=block-unsafe-code-execution

## What it misses

This policy does not state what it misses.

## Examples

- Refused: A staged file passes model output to the Python eval builtin.
- Allowed: A staged file calls model.eval() to switch a torch module to inference mode.

## Latest change

0.1.1 · 2026-10-07 — Promoted from draft to production: every test case ran and passed, and no bug report was open. Behaviour unchanged.

## Provenance

- Tested by 54 of 54 cases run automatically
- SHA-256: `60d4615a014eb1a7610ae904f64f60af24687385c5f2655768c4959898b48f9c`
- Catalog commit: https://github.com/open-coder-ai/chock-catalog/commit/1e60d211c1bb767152c6ab0167932da06ab3a10f
- Source: https://github.com/open-coder-ai/chock-catalog/tree/1e60d211c1bb767152c6ab0167932da06ab3a10f/agentic-security/block-unsafe-code-execution (catalog path `agentic-security/block-unsafe-code-execution`)
- Presets: Code hardening
- JSON: `/api/coding/policies/block-unsafe-code-execution.json`
- Report a problem: https://chock.sh/report/?policy=block-unsafe-code-execution&version=0.1.1&page=%2Fcoding%2Fpolicies%2Fblock-unsafe-code-execution%2F
