Case 27 · Flagship

Agent Security Contract

Fail-closed security contract for AI agents and MCP tool calls: abuse-case corpus, ALLOW / BLOCK / REQUIRE_APPROVAL verdicts in CI, and hash-checked evidence envelopes.

01

How it works

From policy to a fail-closed verdict.

Agent Security Contract by Andrey Lesnikov — pin a capability policy, evaluate agent and MCP tool-call traces before execution, and ship a CI-grade evidence envelope.

Agent Security Contract architecture: policy and trace into evaluator, verdicts, evidence envelope, CLI and GitHub Action
Pre-execution enforcement plane: capability contract → fail-closed verdict → evidence envelope.
Agent Security Contract lifecycle: Policy, Trace, Evaluate, Verdict, Envelope
Lifecycle — Policy → Trace → Evaluate → Verdict → Envelope
  1. 01

    Pin the capability policy

    YAML declares the capability catalog, a pinned sha256 capability digest, per-agent tool allowlists, argument constraints, high-impact approval, and rate limits.

  2. 02

    Evaluate the tool-call trace

    asc check (or the HTTP sidecar / GitHub Action) compares the trace to the policy. Malformed policy, digest mismatch, unknown tool, evaluator error, or timeout all return BLOCK.

  3. 03

    Emit a disposition

    Verdicts are ALLOW, BLOCK, or REQUIRE_APPROVAL — mapped to OWASP ACS ALLOW / DENY / ASK — with exit codes 0 / 1 / 2 for CI admission.

  4. 04

    Prove with an envelope

    Each decision writes an evidence envelope (policy_sha256, trace_id, commit_sha, envelope_sha256). asc verify rejects tampering against the integrity digest; envelopes are hash-checked, not signed.

02

Evidence

From problem to proof.

How the system is framed, operated, and proven — not a slide deck summary.

01
Problem

Agent and MCP stacks expand the attack surface beyond prompt text: tool misuse, poisoned tool descriptions, argument injection, and unapproved high-impact actions. Without a pre-execution gate, those calls run before anyone can deny them.

02
Architecture

ASC is a platform gate: a pinned YAML capability policy plus a tool-call trace feed an evaluator that returns ALLOW, BLOCK, or REQUIRE_APPROVAL. Delivery paths are the asc CLI (check / verify / corpus), an HTTP sidecar with a fail-closed client, and the reusable GitHub Action justrunme/[email protected]. Every verdict emits an evidence envelope with policy SHA-256, trace ID, commit SHA, and an integrity digest.

03
Trade-offs

ASC evaluates static traces and pre-execution hook payloads against a declared policy. It is not a runtime OS sandbox, a prompt-injection detector, a full ACS wire Guardian, or a signer: envelopes carry an unkeyed integrity digest (hash-checked, not signed). Complementary to Promptfoo-style red teaming and ACS Guardians — not a replacement.

04
Latest evidence

Release v0.1.0 on this corpus of 28 scenarios (14 attack, 14 benign): critical false-ALLOW 0, benign false-BLOCK 0/14, corpus passed, suite wall-clock 16 ms (docs/EVIDENCE.md, results/results.json). Scenarios map to OWASP ACS Instrument.toolCallRequest dispositions (ALLOW / DENY / ASK) and OWASP Agentic Top 10 risks (for example ASI01 goal hijack, ASI02 tool misuse, ASI04 MCP tool poisoning). CI run https://github.com/justrunme/agent-security-contract/actions/runs/38871805381. Metrics apply on this corpus only.

Constraints

Pinned capability digests, ALLOW / BLOCK / REQUIRE_APPROVAL verdicts, fail-closed defaults, OWASP ACS and Agentic Top 10 mapping, and CI-grade evidence envelopes that are hash-checked (not signed).

03

Related

Nearby systems.

Case 05 · Flagship

BlastGuard

  • SBOM
  • Advisories
  • Sigstore

CVE scanners produce finding counts

Blast radius predicted before CVE count

Case 19 · Flagship

AI Runtime Platform

  • Python
  • vLLM
  • KServe

AI workloads often start as API calls but become production systems that need identity, policy, scaling, telemetry, and clear ownership

Every model call: policy + trace + budget

Case 15 · Pattern

Policy as Code Guardrails

  • OPA
  • Feedback
  • Promote

Security and platform rules are often discovered only after deployment or during reviews

Standards enforced in CI, not slides

Available for meaningful infrastructure conversations

Build systems that stay calm under pressure.

Available for conversations

Talk infrastructure

Book a working session

Meet ↗

Evidence first

For deep dives

Explore the systems

All cases ↗