Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Test vectors

Note

Specification: draft. The engine conformance test and shiin policy test execute every vector.

Test vectors encode the golden use cases and are the conformance corpus that implementations are checked against.

Format

Each test vector is a JSON file in docs/spec/test-vectors/ validated against test-vector.v1.schema.json.

A test vector records one action request, the policy it is evaluated against, and the expected decision.

Optional fields carry the remaining engine inputs, so that every vector can be decided from the vector alone:

FieldMeaning
taskThe active task declaration, for vectors that exercise intent binding.
modeattended or unattended. Absent means attended.
usageWhat the task has used before this action, for vectors that exercise limits.
nowThe evaluation time, for vectors that exercise a task expiry.

Golden use cases

IDUse caseVector file
TV-001An allowed edittv-001-allowed-edit.v1.json
TV-002A denied read of a secrettv-002-denied-secret.v1.json
TV-003A command with unknown effectstv-003-opaque-command.v1.json
TV-004An action outside the tasktv-004-outside-task.v1.json
TV-005A bulk deletiontv-005-bulk-delete.v1.json
TV-006A destructive VCS operationtv-006-destructive-vcs.v1.json
TV-007An unattended denytv-007-unattended-deny.v1.json
TV-008No rule matches, so the default decision appliestv-008-default-deny.v1.json
TV-009A secret read through a shell command, denied by the same rule as a direct readtv-009-secret-via-shell.v1.json
TV-010A task’s write limit is reachedtv-010-task-limit.v1.json
TV-011An expired task no longer constrainstv-011-task-expired.v1.json
TV-012A task asks a person about an action typetv-012-task-asks.v1.json
TV-013A task limits which hosts may be reachedtv-013-task-host.v1.json
TV-014Task scope denial wins over required approvaltv-014-task-deny-before-pending.v1.json
TV-015A task forbids a read performed through a shell commandtv-015-task-forbidden-effect.v1.json
TV-016Workspace-relative task scope excludes another workspacetv-016-task-scope-root.v1.json
TV-017A spent task budget wins over required approvaltv-017-task-budget-before-pending.v1.json
TV-018Outside-workspace risk denies an otherwise allowed writetv-018-outside-workspace-risk.v1.json
TV-019Secret-path risk denies an otherwise allowed readtv-019-secret-path-risk.v1.json
TV-020Missing capability denies an otherwise allowed actiontv-020-missing-capability.v1.json
TV-021Capability denial wins over a broad capability granttv-021-capability-deny-wins.v1.json
TV-022Every effect class requires an explicit capabilitytv-022-capability-effect.v1.json
TV-023A capability does not replace policy authorizationtv-023-capability-not-authority.v1.json
TV-024Session and task rule selectors match togethertv-024-rule-session-task.v1.json
TV-025A different session cannot match a scoped ruletv-025-rule-session-mismatch.v1.json
TV-026An absent task cannot match a task-scoped ruletv-026-rule-task-missing.v1.json

Running

Implementations run every vector and check the decision matches. The source runner checks the reason code as well as the decision.

$ cargo xtask conformance

This writes target/conformance/report.json with the tested Git revision, per-case expected/actual outcomes, and SHA-256 digests of the copied vectors and schemas. An optional directory argument selects the bundle location. The documentation workflow publishes the core-conformance artifact for third-party implementations to download and compare. The report covers core engine behavior; it is unsigned and does not establish host interception, identity assurance, external MCP conformance, or independent security review.

Revision history

  • v1-draft.6 (2026-10-16): Migrated existing policy snapshots to explicit capabilities and added capability denial/precedence/effect coverage and session/task selector cases.
  • v1-draft.5 (2026-10-12): Added TV-014 to TV-019 for task denial precedence, forbidden effects, workspace-relative scope boundaries, and configured path risk signals.
  • v1-draft.4 (2026-10-12): Added TV-010 to TV-013 for task limits, expiry, ask-for, and host constraints, and the usage and now fields they need.
  • v1-draft.3 (2026-10-12): Added TV-009, which pins UC-02: a rule written for fs.read must also cover a read performed by a shell command.
  • v1-draft.2 (2026-10-12): Added TV-008 for the default decision, a workspace root to every request, and the optional task and mode fields, so TV-004 and TV-007 are decidable from their own inputs.
  • v1-draft.1 (2026-10-01): Initial draft.