@agenttrail/guardrails 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -126,6 +126,7 @@ Here is a complete rule. Nothing is hidden; this is the actual shape.
126
126
  "defaultAction": "block",
127
127
  "title": "git reset --hard discards uncommitted work",
128
128
  "description": "Discards all uncommitted changes. Does not match `git restore` (see wt.restore-path).",
129
+ "owasp": ["ASI02", "LLM03"],
129
130
 
130
131
  // What to look for. This one matches a Bash command against a regular expression.
131
132
  "match": {
@@ -155,6 +156,7 @@ Reading the fields:
155
156
  | `severity` | How bad the thing being caught is: `critical`, `high`, `medium`, `low`, `info`. **It is not a price**: this package ships no mapping from severity to money. |
156
157
  | `defaultAction` | What should happen: `block` (refuse), `require_approval` (ask a human), or `warn` (allow, but say so). A user can override it. |
157
158
  | `description` | What the rule catches **and what it misses**. The honest limits are part of the rule, not a footnote. |
159
+ | `owasp` | Optional. The [OWASP risks](#owasp-coverage) the rule addresses, as ids such as `ASI02` or `LLM06`, in list order. Every rule in this package has at least one. Versions up to and including 0.2.2 reject the field, so validate a rule that carries it with 0.2.3 or later. |
158
160
  | `match` | The condition. `any_of` means "any one of these is enough". |
159
161
  | `fixtures` | Examples that must match, and examples that must not. |
160
162
 
@@ -198,15 +200,26 @@ Several packs exist because of risks named in OWASP's two lists for AI systems:
198
200
  action that comes out of it, so these rules address a risk at the point where it turns into a
199
201
  command or a file change.
200
202
 
201
- | Pack | Agentic risks | LLM risks |
202
- |---|---|---|
203
- | `working-tree`, `destructive-data`, `prod-infra`, `file-scope` | ASI02 Tool Misuse and Exploitation | LLM03 Excessive Agency |
204
- | `rce-supply-chain` | ASI05 Unexpected Code Execution, ASI04 Agentic Supply Chain | LLM04 Supply Chain |
205
- | `privilege-supply-chain` | ASI03 Identity and Privilege Abuse, ASI04 Agentic Supply Chain | LLM04 Supply Chain |
206
- | `secret-exposure`, `exfiltration` | ASI02 Tool Misuse and Exploitation, ASI03 Identity and Privilege Abuse | LLM02 Sensitive Information Disclosure |
207
- | `safety-bypass` | ASI09 Human-Agent Trust Exploitation | LLM10 Improper Output Handling (`gb.ansi-terminal-forgery`) |
208
- | `agent-context` | ASI06 Memory and Context Poisoning (the write, not its contents), ASI10 Rogue Agents | LLM03 Excessive Agency |
209
- | `test-integrity` | ASI10 Rogue Agents, ASI09 Human-Agent Trust Exploitation | |
203
+ | Pack | Agentic risks | LLM risks | Default action |
204
+ |---|---|---|---|
205
+ | `working-tree`, `destructive-data`, `prod-infra`, `file-scope` | ASI02 Tool Misuse and Exploitation | LLM03 Excessive Agency, LLM10 Improper Output Handling (`block-destructive-sql`) | `block` or `require_approval` |
206
+ | `rce-supply-chain` | ASI04 Agentic Supply Chain, ASI05 Unexpected Code Execution | LLM04 Supply Chain, LLM07 Misinformation (`rce.unverified-package`) | `block` or `require_approval` |
207
+ | `privilege-supply-chain` | ASI03 Identity and Privilege Abuse, ASI04 Agentic Supply Chain | LLM03 Excessive Agency (`ps.iam-grant`), LLM04 Supply Chain, LLM07 Misinformation (`flag-dependency-install`) | `require_approval`, except `flag-dependency-install`, which is `warn` |
208
+ | `secret-exposure`, `exfiltration` | ASI02 Tool Misuse and Exploitation, ASI03 Identity and Privilege Abuse | LLM02 Sensitive Information Disclosure | `secret-exposure` is mostly `warn`; `exfiltration` is `block` or `require_approval` |
209
+ | `safety-bypass` | ASI09 Human-Agent Trust Exploitation | LLM10 Improper Output Handling (`gb.ansi-terminal-forgery`) | `require_approval`, except `gb.ansi-terminal-forgery`, which is `warn` |
210
+ | `agent-context` | ASI03 Identity and Privilege Abuse (`ac.agent-autonomy-flag`), ASI04 Agentic Supply Chain (`ac.mcp-server-add`), ASI06 Memory and Context Poisoning (the write, not its contents), ASI10 Rogue Agents | LLM03 Excessive Agency | `require_approval` |
211
+ | `test-integrity` | ASI10 Rogue Agents, ASI09 Human-Agent Trust Exploitation | | Mostly `warn`; deleting a test file or editing a test runner's configuration is `require_approval` |
212
+
213
+ Each rule lists the ids it addresses in its own `owasp` field, so
214
+ `RULES.filter((rule) => rule.owasp?.includes("ASI06"))` gives the rules behind one risk. Each row
215
+ above is the union of its packs' ids, with the rule named where only one rule in the pack carries
216
+ an id. A test keeps the table and the rules' ids equal.
217
+
218
+ Read the default action before relying on a risk. A `warn` rule lets the action proceed and records
219
+ it; only `require_approval` and `block` stop it. Reading a secret is a normal part of a normal day,
220
+ so most secret-exposure rules warn, and a dependency install is flagged, not held. A file tool
221
+ carries a path rather than content, so `ac.memory-store-edit` cannot see what was written to a
222
+ memory file. You can change any rule's action in your own configuration.
210
223
 
211
224
  What the rules cannot address, by design:
212
225