Skip to content

Guard precision: classify only write targets, read globs, jq/awk, managed scripts, .env stem - #1098

Merged
woksin merged 10 commits into
mainfrom
ai-guard-precision
Nov 10, 2026
Merged

woksin merged 10 commits into
mainfrom
ai-guard-precision

Conversation

@woksin

@woksin woksin commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

Hook change: run cratis ai update in each consuming repository to pick up the new guard behavior.

Fixed

A repository or file name such as Org.DS.EnvironmentalReporting or
Cratis.Environments.Specs no longer counts as a protected .env reference.
.env, .env.local, app.env and .envrc stay protected.
…es (#1041)

Extended-glob groups in a write target are read as one star, and a brace
span holding quoting or expansion syntax now fails the classifier closed.
Quoted text is neutralized first so quoted literals keep their verdicts.
The shell write guard gains a targets mode: when every command in the text
is accepted by the read-only policy, the words of pure readers are no longer
classified; redirects, git commit -F and directory changes still are. Any
unparsed or non-accepted command falls back to whole-text classification.
…te guard (#1041, #1052)

jq is accepted with display flags only and no value-taking option. awk is
accepted only as awk [-F sep] 'program' operands, and a program containing
any output, pipe, exec, getline, close, fflush or @ directive is refused.
…ser failure (#1041)

A command that is not read-only is refused whatever the reference classifier
could model, so program text in an interpreter heredoc no longer surfaces as a
parser failure. Read-only commands keep the fail-closed parser failure.
The whole-stem boundary no longer applies when glob syntax sits in or after
the stem, so .en?r? and .e?vx stay protected. Hostile specs cover the cases.
The .env stem boundary is now an allowlist: it is released only when the
stem is literal and the rest of its path component is [a-z0-9._-]. Any
expansion, quote, escape, glob, brace or tilde keeps it protected.
jq --rawfile/--slurpfile file operands are now judged like other operands.
@woksin
woksin requested a review from a team as a code owner November 10, 2026 05:00
@woksin woksin added the patch Patch level semantic version impact label Nov 10, 2026
@woksin woksin self-assigned this Nov 10, 2026
@woksin

woksin commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator Author

Tier 1 green; deep security review passed in round 3, and every finding is fixed with hostile-case specs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Patch level semantic version impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant