Download README.md from justrunme/agent-security-contract: direct link, hf CLI and curl.
- Browser
- Download file 4.08 kB
-
https://huggingface.co/spaces/justrunme/agent-security-contract/resolve/main/README.md
- Command line
-
hf download hf://spaces/justrunme/agent-security-contract/README.md
-
curl -L -o README.md https://huggingface.co/spaces/justrunme/agent-security-contract/resolve/main/README.md
title: Agent Security Contract
emoji: 📜
colorFrom: yellow
colorTo: green
sdk: static
pinned: false
license: apache-2.0
short_description: Fail-closed agent tool-call gate, runs in your browser
tags:
- ai-security
- agents
- policy-engine
- owasp
Agent Security Contract — policy engine demo
This is a policy engine demo, not a trained model. It runs the open-source Agent Security Contract evaluator (release v0.2.1, commit 768853bde5a56fcc6c9b486f52848761db1b0ef1) against the project's own demo policy and corpus traces. No model is loaded, and no tool is executed.
This page runs entirely in your browser. After the first load, traces and policies you enter are evaluated locally by the bundled library and are not sent to a server. The page loads the Pyodide 0.29.5 runtime and its built-in PyYAML package from that pinned CDN; the ASC wheel, demo policy, and corpus are bundled in this Space.
Pyodide 0.29.5 states a minimum of Safari 16.4 (27 March 2023). On an older browser the live engine does not start, and the page shows precomputed official-corpus results instead of a raw runtime error. Open the page on a current desktop browser to evaluate a custom trace yourself.
ASC is a deny-by-default, pre-execution gate for agent and MCP tool calls. A YAML capability contract is pinned by SHA-256 catalog digest. Each proposed tool-call trace is evaluated before anything would run, and the library returns one of three verdicts:
ALLOWBLOCKREQUIRE_APPROVAL
Those map to OWASP Agent Control Standard dispositions ALLOW / DENY / ASK. Malformed policy, malformed trace, digest mismatch, unknown tool, or evaluator error all resolve to BLOCK (fail-closed). Every decision emits an integrity-checked JSON evidence envelope (policy_sha256, trace_id, commit_sha, envelope_sha256). The digest is unkeyed: it is hash-checked, not signed.
The page is styled as an audit certificate. Above the interactive decision, an Audit at a glance section shows the official corpus run as a verdict ledger (expected vs actual, one stamp per scenario), a severity breakdown, the attack classes, and the contract clauses that decided each attack. All of it is drawn from the bundled precomputed v0.2.1 corpus run (data/insights.json is derived from data/precomputed.json).
The demo opens on an official corpus case, with a color-coded verdict, the tool-call sequence, and the evidence envelope. You can browse the official v0.2.1 corpus (66 scenarios: 33 attack, 33 benign) in the gallery, run all 66 scenarios in the browser, or paste a custom trace and policy under Advanced. A tamper control edits one envelope field and calls verify_envelope so you can see the library reject a hash mismatch.
License: Apache-2.0 (see LICENSE and NOTICE).
Links
- Research preprint: Fail-Closed Authorization for Tool-Using AI Agents
- Case write-up: Agent Security Contract
- Source: github.com/justrunme/agent-security-contract
- Zenodo DOI: 10.5281/zenodo.24075886
- Author ORCID: 0009-0004-7583-4314
- Related work by the same author, Airlock (in-browser policy-gate demo): justrunme/airlock
- Airlock corpus: justrunme/airlock-agent-security-corpus
- Collection: Agent security: fail-closed authorization
- Book: Prove It Before Production
Claims about corpus results belong to that release and that corpus only. This demo does not restate or extend them.