Assay
Policy-as-Code for AI Agents. Deterministic testing, runtime enforcement, and verifiable evidence for the Model Context Protocol.
Open Core: Engine + baseline packs are open source (MIT/Apache-2.0). Enterprise packs and managed workflows are commercial. See ADR-016 for details.
Install
|
Or via Cargo:
Core Workflow
1. Record → Replay → Validate
Record agent behavior once, replay deterministically in CI. No LLM calls, no flakiness.
# Capture traces from your agent
# Validate against policy (milliseconds, $0 cost)
# CI gate with SARIF output
2. Generate Policies from Behavior
# Single trace → policy
# Multi-run profiling for stable policies
3. Evidence Bundles
Tamper-evident bundles with content-addressed IDs. CloudEvents v1.0 format.
# Export evidence
# Verify integrity
# Lint for security issues (SARIF output)
# Lint with compliance pack
# Compare runs
4. Compliance Packs
Built-in rule packs for regulatory compliance. Article-referenced, auditor-friendly.
# EU AI Act Article 12 (logging requirements)
# Multiple packs
# Custom pack
SARIF output includes article references for audit trails.
5. Pack Registry (Secure, Reproducible Pack Fetching)
Assay resolves --pack references in a deterministic order:
- Local (
./custom.yaml) - Bundled (
packs/open/<name>) - Registry (
name@versionor pinnedname@version#sha256:...) - BYOS (
s3://,gs://,az://)
All remote packs are verified before use:
- Canonical digest: strict YAML subset → JSON → JCS (RFC 8785) → SHA-256
- Authenticity: Ed25519 + DSSE signature verification for commercial packs
- Sidecar signatures:
GET /packs/{name}/{version}.sig(avoids header size limits)
Trust model is no-TOFU:
- CLI ships with pinned root key IDs
- Registry publishes a DSSE-signed keys manifest (
GET /keys) - Pack signatures must chain to manifest keys (revocation/expiry enforced)
For reproducible CI, assay.packs.lock (v2) pins name/version/digest/signature metadata. Lockfile mismatches are hard errors.
See SPEC-Pack-Registry-v1 for the full protocol specification.
6. Tool Signing
Cryptographic signatures for tool definitions. Ed25519 + DSSE.
# Generate keypair
# Sign tool definition
# Verify signature
7. BYOS (Bring Your Own Storage)
Push evidence to your own S3-compatible storage. No vendor lock-in.
# Push bundle
# Pull by ID
# List bundles
Supports: AWS S3, Backblaze B2, Cloudflare R2, MinIO, Azure Blob, GCS.
Runtime Enforcement
MCP Server Proxy
# Start policy enforcement proxy
Kernel-Level Sandbox (Linux)
# Landlock isolation (rootless)
# eBPF/LSM enforcement (requires capabilities)
GitHub Action
- uses: Rul1an/assay/assay-action@v2
Zero-config evidence verification. Native GitHub Security tab integration.
v2.1 features:
- Compliance packs (
pack: eu-ai-act-baseline) - BYOS push with OIDC (
store: s3://bucket/evidence) - Artifact attestation (
attest: true) - Coverage badges
# Full example
- uses: Rul1an/assay/assay-action@v2
with:
pack: eu-ai-act-baseline
store: s3://my-bucket/evidence
store_role: arn:aws:iam::123456789:role/AssayRole
attest: true
See GitHub Marketplace | Guide.
Configuration
assay.yaml:
version: "2.0"
name: "mcp-default-gate"
allow:
deny:
- "exec*"
- "shell*"
constraints:
- tool: "read_file"
params:
path:
matches: "^/app/.*|^/data/.*"
Python SDK
# Record traces
=
# Validate
=
assert
Pytest plugin for automatic trace capture:
pass
Documentation
Contributing
See CONTRIBUTING.md.