block-invisible-unicode
The mechanizable slice of prompt-injection defense, enforced at two points: at commit (the git hook, over staged changes) and at agent tool-use (over a tool call's arguments, as the agent writes) -- invisible and direction-override Unicode. Bidi controls make code read differently than it parses (Trojan Source, CVE-2021-42574); Unicode tag-block characters smuggle instructions that are invisible to a human reviewer but fully legible to the agent reading the file. Zero-width joiners and bidi marks (ZWJ/ZWNJ/LRM/RLM) are deliberately NOT matched -- they are legitimate in emoji sequences and in Persian, Arabic and Indic text -- so ordinary internationalised content passes; only the override/embed/isolate controls and the tag block, which have no honest use in a source tree, are blocked. Escape: 'pragma: allowlist invisible-unicode' on the same line.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-15
- Stars
- ★ 10
- Forks
- 1
01 前言 Front Matter
- name
- block-invisible-unicode
- metadata
- { "chock.artifact": "hook", "chock.enforcement": "block", "chock.coverage_without_chock": "advisory" }
- description
- The mechanizable slice of prompt-injection defense, enforced at two points: at commit (the git hook, over staged changes) and at agent tool-use (over a tool call's arguments, as the agent writes) -- invisible and direction-override Unicode. Bidi controls make code read differently than it parses (Trojan Source, CVE-2021-42574); Unicode tag-block characters smuggle instructions that are invisible to a human reviewer but fully legible to the agent reading the file. Zero-width joiners and bidi marks (ZWJ/ZWNJ/LRM/RLM) are deliberately NOT matched -- they are legitimate in emoji sequences and in Persian, Arabic and Indic text -- so ordinary internationalised content passes; only the override/embed/isolate controls and the tag block, which have no honest use in a source tree, are blocked. Escape: 'pragma: allowlist invisible-unicode' on the same line.
03 SKILL.md 正文
Block Invisible Unicode
The mechanizable slice of prompt-injection defense, enforced at two points: at commit (the git hook, over staged changes) and at agent tool-use (over a tool call's arguments, as the agent writes) -- invisible and direction-override Unicode. Bidi controls make code read differently than it parses (Trojan Source, CVE-2021-42574); Unicode tag-block characters smuggle instructions that are invisible to a human reviewer but fully legible to the agent reading the file. Zero-width joiners and bidi marks (ZWJ/ZWNJ/LRM/RLM) are deliberately NOT matched -- they are legitimate in emoji sequences and in Persian, Arabic and Indic text -- so ordinary internationalised content passes; only the override/embed/isolate controls and the tag block, which have no honest use in a source tree, are blocked. Escape: 'pragma: allowlist invisible-unicode' on the same line.
on(commit|tool_use): block(content_regex) scan=added_lines allowlist_pragma=pragma:\s*allowlist\s+invisible-unicode ...
Invisible or direction-override Unicode detected in this change. These characters change how code reads to a human or hide instructions an agent will still obey. Remove them. 'pragma: allowlist invisible-unicode' on the same line marks a documented exception; in the agent (tool use, the turn's end) it counts only when that exact line is already committed in HEAD, so an agent asks a person rather than writing the pragma itself.
This skill is advisory: the client reading it has no mechanism to enforce it. The same policy compiled by chock blocks at commit, on an agent's file writes and at turn end. See https://github.com/open-coder-ai/chock
04 同仓库更多 Skills
validate
Lint Chock policy conformance. args(policy_id or all) returns(findings, verdict) invoke(validate, check, promotion_to_review) exclude(eval, optimize)
policy-init
Create conformant Chock policy from request. args(request, target_path, artifact_hint) returns(folder, wiring) invoke(skill, hook, rule, workflow, convention, always_never) exclude(coding, edit_existing)
optimize
Improve Chock policy from usage evidence. args(policy_path, >=3 traces) returns(promoted_edit / rejected_record / no_bar) invoke(misfire, ignore, tuning) exclude(policy_init, one_off_edit)
eval
Run Chock policy eval suite. args(policy_path) returns(pass_rate, verdict) invoke(test, run_evals, promotion_check) exclude(validate, optimize)
chock-init
Onboard a repo into Chock. args(repo_path, agents, agent_agnostic) returns(wiring) invoke(onboard, scaffold, setup) exclude(coding, policy_creation)
validate
Lint Chock policy conformance. args(policy_id or all) returns(findings, verdict) invoke(validate, check, promotion_to_review) exclude(eval, optimize)