Reference
Capability spec reference
The format of a capability spec (v1), and the exact contract evaluate() follows when it checks a tool call against one.
Format
task: "summarize meeting-notes.txt" # required, human-readable deny_all_others: true # default true; see "Weak posture" servers: # required, at least one entry filesystem: tools: list_allowed_directories: # no args block: zero-arg calls only read_text_file: args: # exhaustive: unlisted args are DENIED path: must_match_one_of: # exact string match, no globs or regex - "/home/user/aegis-sandbox/meeting-notes.txt" intercepts: # optional, operator policy - server: filesystem tool: write_file
The args block
| Spec says | Meaning |
|---|---|
tool with no args (or args: ~) | Zero-arg tool. Any call that passes arguments is denied (rule 3). |
args: {} | Tool allowed, with no arguments named. Any argument is denied (rule 6). The audit log tells this apart from the zero-arg case. |
arg: ~ | The argument must be present. Any scalar value is allowed. A list value is denied. |
must_match_one_of: [...] | The value must equal one entry exactly. For a list, every element must be listed. Can't be an empty list. |
allow_any: true | Turns off value checking for this one argument. Can't be combined with must_match_one_of. Recorded as rule-7-bypassed-allow-any. |
Evaluation rules
Rules are checked in order. The first DENY wins, and a call is allowed only if every check passes. Rules 1–8 decide ALLOW or DENY. Rule 9, intercepts, is applied to an ALLOW afterwards.
| # | Condition | Verdict | matched_rule |
|---|---|---|---|
| 1 | Server not in servers: | DENY | rule-1-server-not-listed |
| 2 | Tool not in tools: for that server | DENY | rule-2-tool-not-listed |
| 3 | No args block, but the call passed arguments | DENY | rule-3-zero-arg-violation |
| 4 | No args block, call passed no arguments | ALLOW | null |
| 5 | An argument named in the spec is missing from the call | DENY | rule-5-missing-required-arg |
| 6 | The call passes an argument the spec doesn't name | DENY | rule-6-extra-arg |
| 7 | A value isn't allowed (see value types) | DENY | rule-7-* |
| 8 | All checks pass | ALLOW | null, or the waiver's rule id |
| 9 | An ALLOW whose (server, tool) is in intercepts | INTERCEPT | rule-9-intercept-required |
Rules 5 and 6 check opposite things: 5 looks for arguments the spec names but the call left out, 6 for arguments the call added. Together they make the set of argument names closed in both directions.
When the spec says nothing
| What the spec doesn't mention | Verdict |
|---|---|
Server not in servers: | DENY |
Tool not in tools: | DENY |
Argument in the call but not in args: | DENY |
Argument with no must_match_one_of, scalar value | ALLOW on any value |
Argument with no must_match_one_of, list value | DENY rule-7-unconstrained-collection |
| Dict, nested list or other non-scalar value | DENY rule-7-unsupported-arg-type |
Tool listed with no args: block | ALLOW only for zero-arg calls |
Argument value types
Rule 7 classifies a value before matching it. The comparison is str(value) against literal strings. That is faithful for a scalar, but for a container it would compare a Python repr that no operator ever wrote. So containers are handled separately:
| Value | With must_match_one_of | Unconstrained |
|---|---|---|
Scalar: str, int, float, bool, None | Exact match | ALLOW (any value) |
Collection of scalars: list, tuple, set, frozenset | Every element must be listed, in any order. Empty → DENY rule-7-empty-collection | DENY rule-7-unconstrained-collection |
Anything else: dict, nested list, bytes, objects | DENY rule-7-unsupported-arg-type | DENY rule-7-unsupported-arg-type |
{"read_multiple_files": {"args": {"paths": {"must_match_one_of": [
"C:/s/a.txt",
"C:/s/b.txt",
]}}}}
# ALLOW ["C:/s/a.txt"] - subset
# ALLOW ["C:/s/b.txt", "C:/s/a.txt"] - any order
# DENY ["C:/s/a.txt", "/etc/shadow"] - rule-7-value-not-allowed
# DENY [] - rule-7-empty-collectionThe classifier fails closed. A value shape nobody listed can't be allowed just because its __str__ happens to match. The bypass write-up explains why this matters.
Waiving a check with allow_any
Sometimes an operator really does need an unchecked argument. Making them fake a constraint would be worse, so they can say so directly:
read_multiple_files:
args:
paths:
allow_any: true # ANY paths, including outside the sandboxIt is off by default and has to be written deliberately. Every call it allows is recorded with matched_rule: "rule-7-bypassed-allow-any", so a search for waivers finds it.
Weak posture
Setting deny_all_others: false lets unlisted servers and tools through, recorded as rule-1-bypassed-weak-posture or rule-2-bypassed-weak-posture. The spec only loads if its task contains the string deny_all_others=false, so weakening the policy has to be acknowledged in writing.
Intercepts: pausing for human approval
intercepts is a top-level list of exact (server, tool) pairs. They're matched exactly, with no wildcards. Intercepts are checked after rules 1–8:
- If rules 1–8 DENY, the verdict stays DENY. An intercept never rescues a denied call.
- If rules 1–8 ALLOW and the pair matches, the verdict becomes INTERCEPT.
- Otherwise it stays ALLOW.
Intercepts are operator policy. propose_spec() never writes them, because which calls need a human is a risk decision that can't be inferred from a task description.
task: "clean up stale exports in the reports directory"
deny_all_others: true
servers:
filesystem:
tools:
list_directory:
args:
path: ~
delete_file:
args:
path: ~
intercepts:
- server: filesystem
tool: delete_fileThe agent can list the directory freely. Every delete_file call is in scope but intercepted, so the operator approves or declines each deletion one at a time. See handling intercepts for the runtime behaviour.
Validation at load time
Specs are validated when load_spec() or propose_spec() runs, never at evaluation time, so evaluate() only ever sees a valid spec. A SpecValidationError names the field that failed. Common causes:
- Missing
taskorservers. must_match_one_of: []. An empty allow-list can't match anything.allow_anyandmust_match_one_ofset on the same argument.deny_all_others: falsewithout the acknowledgement intask.
spec_hash and the spec_loaded record
When a spec loads, Aegis writes one record before returning it. This ties the run to the exact spec that governed it:
{"status": "spec_loaded", "task": "summarize meeting-notes.txt",
"deny_all_others": true, "spec_hash": "…", "run_id": "…"}spec_hash is the SHA-256 of the raw YAML bytes, taken before parsing. Every governed call record carries it too, so you can rebuild the active policy even after the file on disk has changed. run_id appears on this record only if you pass run_id=config.run_id to the loader.
What v1 doesn't handle
- Pattern matching of any kind: no globs, regex or prefix matching. This is a deliberate choice, not a missing feature.
- Constraints on dict-valued or nested arguments. These are denied unless waived with
allow_any. - Changing a spec during a run. A spec is frozen for the whole run.
Source of truth: CAPABILITY_SPEC.md on GitHub. If this page and the repository disagree, the repository wins — and please open an issue.