Context Firewall
Use the public AIWG CLI to inspect context that can enter provider sessions. Keep
scans read-only, never print source bodies as part of a threat finding, and treat
baseline confirmation as an attestation that every planned record was reviewed.
Triggers
- "audit context" → run the read-only firewall scan
- "check context budget" → scan and explain budget attribution
- "review memory baseline" → produce the full baseline plan without writing
- "approve the context baseline" → plan first, then request explicit write authorization
- "doctor says the context baseline is missing" → route to the plan-first workflow
Process
- Run
aiwg context-firewall scan, adding repeatable --provider <name>,
--strict, or --json only when the task needs them.
- Report violations and warnings using paths, trust labels, review states,
digests, sizes, and signal identifiers. Do not reproduce suspicious content.
- If a baseline is requested, run
aiwg context-firewall baseline --plan.
Inspect every emitted record and surface any quarantined, stale, external, or
changed entry before considering a write.
- Do not infer approval from a request to scan, diagnose, plan, or repair.
Baseline mutation requires explicit user authorization after the plan has
been presented and reviewed.
- Only after that authorization, run
aiwg context-firewall baseline --write --confirm-reviewed. Use
--output <project-relative-path> only when the user requested a custom
destination.
- Re-run
aiwg context-firewall scan --strict and report the resulting status.
The writer fails closed for unsafe records, paths outside the project root,
symlink escapes, and missing confirmation. Do not bypass those checks or invoke
the underlying implementation script directly.
Output
Report:
- providers and total portable context budget;
- attribution by memory, rule, skill, agent, generated bridge, and project-local;
- trust and review findings by path, without source bodies;
- whether the operation was read-only or changed the reviewed baseline;
- the final strict scan status.
References
- @$AIWG_ROOT/docs/security/context-memory-firewall.md — operator model and remediation guide
- @$AIWG_ROOT/docs/agents/cli-reference.md — public CLI contract
- @$AIWG_ROOT/tools/security/context-memory-firewall.mjs — packaged engine; never invoke directly for user remediation
1---2namespace: aiwg3name: context-firewall4platforms: [all]5kernel: true6description: Audit provider-facing context, trust, drift, poisoning signals, and budget, then manage the reviewed baseline through a plan-first public CLI workflow7---89# Context Firewall1011Use the public AIWG CLI to inspect context that can enter provider sessions. Keep12scans read-only, never print source bodies as part of a threat finding, and treat13baseline confirmation as an attestation that every planned record was reviewed.1415## Triggers1617- "audit context" → run the read-only firewall scan18- "check context budget" → scan and explain budget attribution19- "review memory baseline" → produce the full baseline plan without writing20- "approve the context baseline" → plan first, then request explicit write authorization21- "doctor says the context baseline is missing" → route to the plan-first workflow2223## Process24251. Run `aiwg context-firewall scan`, adding repeatable `--provider <name>`,26 `--strict`, or `--json` only when the task needs them.272. Report violations and warnings using paths, trust labels, review states,28 digests, sizes, and signal identifiers. Do not reproduce suspicious content.293. If a baseline is requested, run `aiwg context-firewall baseline --plan`.30 Inspect every emitted record and surface any quarantined, stale, external, or31 changed entry before considering a write.324. Do not infer approval from a request to scan, diagnose, plan, or repair.33 Baseline mutation requires explicit user authorization after the plan has34 been presented and reviewed.355. Only after that authorization, run36 `aiwg context-firewall baseline --write --confirm-reviewed`. Use37 `--output <project-relative-path>` only when the user requested a custom38 destination.396. Re-run `aiwg context-firewall scan --strict` and report the resulting status.4041The writer fails closed for unsafe records, paths outside the project root,42symlink escapes, and missing confirmation. Do not bypass those checks or invoke43the underlying implementation script directly.4445## Output4647Report:4849- providers and total portable context budget;50- attribution by memory, rule, skill, agent, generated bridge, and project-local;51- trust and review findings by path, without source bodies;52- whether the operation was read-only or changed the reviewed baseline;53- the final strict scan status.5455## References5657- @$AIWG_ROOT/docs/security/context-memory-firewall.md — operator model and remediation guide58- @$AIWG_ROOT/docs/agents/cli-reference.md — public CLI contract59- @$AIWG_ROOT/tools/security/context-memory-firewall.mjs — packaged engine; never invoke directly for user remediation