Expand description
Taint / quarantine / watch substrate for AgentStateGraph (see spec/TAINT_SPEC.md).
Dynamic runtime markers that bridge passive observation into
enforcement. Every taint is a first-class commit (auditable,
blameable, full intent metadata) and the pre-commit hook
consults evaluate_access to gate writes.
This crate ships the types + the pure check algorithm. Storage
lives in agentstategraph-storage; commit-pipeline wiring lives
in agentstategraph (the main repository crate).
Structs§
- Quarantine
Params - Parameters for
Repository::quarantine. - Taint
- A taint record. Persisted to the
taintstable in storage and round-tripped across the MCP / FFI / binding surfaces. - Taint
Check - Result of
crate::evaluate_access. Consumed by the pre-commit hook +policy_evaluate_changeintegration. - Taint
Metadata - Flat string-to-JSON map for kind-specific metadata. Wrapped so
we can control the on-disk shape without bleeding
HashMap<String, serde_json::Value>through every API. - Taint
Params - Parameters for
Repository::taint. - Untaint
Params - Parameters for
Repository::untaint. - Unwatch
Params - Parameters for
Repository::unwatch. Watches are lightweight so reason is optional. - Watch
Params - Parameters for
Repository::watch.
Enums§
- Taint
Effect - Pre-commit-hook behavior for this taint.
- Taint
Error - Taint
Kind - Discriminator between the three taint kinds.
- Taint
Severity - Advisory severity. Does not change pre-commit semantics; used by consumers for triage ordering.
- Watch
Direction - Direction a watch threshold fires in.
Constants§
- REVIEW_
CONFIDENCE_ THRESHOLD - Required minimum commit confidence to pass a review-effect taint. Hardcoded at 0.9 per spec/TAINT_SPEC.md §“Effects”.
- VERSION
- Crate version exposed for downstream
MCP/ FFI introspection.
Functions§
- ancestor_
candidates - Filter a candidate set down to taints whose
pathis either equal torequest_pathor a propagating ancestor of it. - evaluate_
access - Evaluate access for
(request_path, agent_id, confidence)against a candidate taint list. Returns the aggregatedTaintCheck.
Type Aliases§
- Unquarantine
Params - Parameters for
Repository::unquarantine. Same shape as untaint.