Skip to main content

MCP server + cross-harness skills for building and operating AI agents safely

Project description

๐Ÿ›ก๏ธ Cinch

Contain your AI agents before they reach production.

MCP server + cross-harness skills for building and operating AI agents safely.

The model proposes; the architecture authorizes and enforces.


Open the live console Install from PyPI View on GitHub


PyPI Python License CI Security MCP


117 6 9 5 5 4 3
controls checklists MCP tools crosswalks protocols templates skills

Grounded in NIST AI RMF ยท CISA Secure AI Development ยท OWASP LLM & Agentic ยท MITRE ATLAS ยท CUSTODY ยท LASM ยท Google SAIF ยท DORA 2025


AI agents can read data, invoke tools, execute code, call APIs, and initiate business processes. When they go wrong โ€” through prompt injection, excessive autonomy, credential theft, or model error โ€” the consequences are only as severe as the environment allows. Cinch gives you the enforceable controls, protocols, and runtime queries to keep that environment contained.

โœจ What's inside

What Why it matters
๐Ÿ“‹ 6 checklists (117 controls) Enforceable, framework-mapped YAML โ€” not advice, controls
๐Ÿ”Ž Probes (host ยท project ยท behaviour) Assess a running agent: inspect its process, its deployment, and how it behaves under attack
๐Ÿ“ก MCP server (9 tools) Any MCP-compatible agent queries controls at runtime โ€” and can collect + verify evidence
๐Ÿ–ฅ๏ธ Assessment console Grade a deployment, get insights + a phased action plan, export JSON/CSV/PDF
๐Ÿง  3 skills Drop-in Hermes skill definitions for security reviews & red-teaming
๐Ÿ“ 5 protocols Step-by-step deployment, incident-response, and evidence collection
๐Ÿ”— 5 mappings Crosswalks: NIST AI RMF ยท OWASP LLM ยท MITRE ATLAS ยท CUSTODY ยท LASM
๐Ÿ“„ 4 templates Security review, risk assessment, agent policy, deployment ADR

๐Ÿ–ฅ๏ธ The assessment console

โ–ถ Try the hosted console โ€” no install required.

One page, two modes: a landing page for the project, and a live containment assessment dashboard. It is not a static mockup โ€” it loads a real assessment result pack and renders the analysis: letter grade, insights, ranked recommendations, and a phased action plan. Mark a control Enforced / Gap / N-A and every one of those re-derives instantly.

View What you get
Overview Grade, containment score, top insights, "do now" queue, open-gap feed, per-checklist counts
Insights & plan Grade + why it was capped, ranked findings, one recommendation per gap (do this โ†’ verify like this), remediation phased Now / Next / Later with exit criteria
Assessment Walk the checklist control by control, attach evidence as you go
Control library All 117 controls across 6 checklists โ€” searchable, filterable, assessable inline
Threat model LASM 7ร—4 attack-surface grid derived live from the catalog's layer mapping
Framework coverage NIST AI RMF, OWASP, CUSTODY, ATLAS, LASM crosswalks against your answers
Export JSON (full result pack for CI gating and diffs), CSV (gap register with phase + rank), PDF (grade, insights, action plan, recommendations, crosswalk)

Where the results come from

Two ways to produce them, one engine grading both:

  1. Probe a running agent โ€” cinch collect observes the real deployment and emits an evidence bundle; cinch verify grades it. This is the primary path.
  2. Review by hand โ€” cinch assess grades a state file a reviewer filled in (or the console session they clicked through).

The grade itself is computed once and shown everywhere: src/cinch/assess.py for the CLI and CI, the dashboard for the browser, both reading their rules โ€” severity weights, grade bands, critical-gap and completeness caps, remediation phases โ€” from docs-site/data/rubric.json. Change a rule there and both follow.

# review by hand
cinch assess --state examples/assessment-state.json            # grade + insights + action plan
cinch assess --state examples/assessment-state.json --out pack.json
cinch console --assessment pack.json                            # open the dashboard on it
cinch assess --state pack.json --fail-on critical               # gate a release (exit 2)

A state file is just what a reviewer decided (see examples/assessment-state.json):

{
  "deployment": "checkout-agent-prod",
  "status":   { "AC-001": "pass", "AC-006": "fail", "AC-014": "na" },
  "evidence": { "AC-006": "retrieval output concatenated into the system turn" }
}

๐Ÿ”Ž Assess a running agent

Nobody wants to hand-answer 117 controls. cinch collect observes the deployment and answers what it can prove, in the agent's own environment.

# 1. probe the agent โ€” out of band, as an operator/sidecar/CI identity
cinch collect --host --pid $AGENT_PID \
              --project /srv/checkout-agent \
              --deployment checkout-agent-prod \
              --sign-cmd 'cosign sign-blob -' \
              --out evidence.json

# 2. grade the evidence
cinch verify --evidence evidence.json --out pack.json --fail-on critical

# 3. look at it
cinch console --assessment pack.json

What each probe family observes

Family Flag Reads Controls
Host --host --pid/--unit The kernel's view of the agent process: UID and NoNewPrivs, capability sets, AppArmor/SELinux confinement, seccomp filter, netfilter egress policy, network namespace and metadata-API reachability, log forwarding and log ownership, credential-shaped env vars, image digest + SBOM, read-only root, cgroup limits AE-001โ€“AE-011
Project --project PATH The authority the deployment grants: MCP tool grants, container/pod security context, NetworkPolicy egress, committed secret material, dependency pinning and hashes, SBOM, vulnerability scanning, provenance attestation and image signing, CI runner posture, threat model and IR docs HE-*, SC-*, AC-003/016/018/019/023
Behaviour --endpoint URL --authorized How the running agent responds to adversarial input: direct injection, injection smuggled through retrieved content, system-prompt extraction, tool enumeration, rate-limit presence RT-001/002/005/008/009, AC-005/006/017

Host findings are also mapped onto the containment controls that assert the same thing (AE-005 egress โ†’ AC-019 exfiltration), labelled derived: so the chain stays visible.

Probes also abstain when the target is the wrong kind of thing: supply-chain and documentation controls (SBOM, dependency scanning, provenance, threat model) report unknown unless the directory is actually a build tree โ€” a build manifest, a CI workflow, or a repository. Reporting "no SBOM" about a config directory would be confidently wrong.

Three statuses, and why unknown matters

pass demonstrably enforced ยท fail demonstrably not ยท unknown the probe could not tell.

unknown is never a pass โ€” and never a fail either. A probe on macOS with no /proc, without CAP_NET_ADMIN, or with no manifest to read says so and leaves the control unreviewed โ€” it costs completeness instead of quietly earning credit. Keyword hits in config are reported as leads to confirm, not as proof a limit is enforced at runtime. Every observation keeps the raw evidence it was derived from, so you can check the probe's reasoning instead of trusting it. Secret names are recorded; secret values never are.

Self-audit is detected, not assumed away

protocols/evidence-collect.md is blunt about this: an agent auditing its own host is both auditor and audited, and a compromised or simply mistaken agent can report every control as enforced.

So collection records who collected what, where and when โ€” and when the collector is the audited party, the bundle is stamped provenance.self_attested: true. Three ways that is detected: the inspected PID is the collector's own; the inspected PID is an ancestor of the collector (the agent spawned it, so it inherits the agent's identity and authority); or the request arrived over MCP, where the requester is an agent by definition. That becomes a critical finding in the assessment, is shown as a red self-attested banner in the console, and is never counted as assurance. Independent evidence means cinch collect run out of band under its own identity, signed with --sign-cmd using a key the agent cannot reach.

Behavioural probing sends adversarial input to a live system, so it refuses to run without --authorized naming the target.

As MCP tools

An auditing agent can drive the same flow:

Tool Use it to
evidence_collect Probe a deployment (host, project_path, endpoint + authorized) โ†’ evidence bundle
evidence_verify Grade a bundle โ†’ score, grade, insights, recommendations, action plan

Bundles collected through MCP are marked self-attested by construction โ€” the requester is an agent. Use them to find problems fast; use an out-of-band signed run when the grade has to mean something.

Three ways to get results into the dashboard:

Route How
Published pack data/assessment.json next to the page โ€” the hosted console opens on one, regenerated by scripts/build_assessment.py
Served pack cinch console --assessment pack.json serves any pack from anywhere on disk
Loaded by hand Load assessment in the console header โ€” accepts an exported pack or a plain state file; ?assessment=<url> also works

Exports round-trip: an exported pack feeds straight back into cinch assess --state or the Load assessment button, so re-assessments diff cleanly.

How the grade works. The score is severity-weighted (critical ร—3, high ร—2, medium/low ร—1) over the controls you actually answered. Grade bands run Aโ€“F, and two kinds of cap can only ever lower the result โ€” the pack always says which cap fired and why:

Cap Effect
1 unenforced critical control grade capped at D
3 or more critical controls grade capped at F
under 60% completeness grade capped at C โ€” a high score describes a sample, not the deployment
under 25% completeness grade I ยท Insufficient evidence โ€” no letter is claimed at all

That last one exists because of a real failure: probing a live Claude Code harness resolved 3 of 117 controls, all passing, and the first version graded it A (Contained). A score computed over three controls says nothing about the other 114. Coverage is part of the verdict, not a footnote.

Serve it yourself

The console reads its catalog with fetch('data/full.json'), so it must be served over HTTP โ€” opening the file directly with file:// makes that fetch fail and falls back to a small offline subset. cinch console does it for you:

pip install cinch-ai-security
cinch console                  # serves on http://127.0.0.1:8787 and opens your browser
cinch console --port 9000      # pick another port
cinch console --no-browser     # headless / remote-friendly
cinch console --host 0.0.0.0   # expose on your LAN (read-only, but consider who can reach it)

The server is read-only, GET/HEAD only, bound to 127.0.0.1 by default, and rooted at the console directory. Assessment state lives in the browser only โ€” nothing is uploaded anywhere.

From a source checkout, the same page is served straight from docs-site/:

git clone https://github.com/nirhalfon/cinch-ai-security.git
cd cinch-ai-security && pip install -e .
python scripts/build_docs_json.py   # regenerate the catalog bundle after editing any YAML
cinch console

Turn a session into evidence

  1. Assess the controls that apply to your deployment (Control library โ†’ expand โ†’ Enforced / Gap / N-A, plus an evidence note).
  2. Read Insights & plan โ€” the grade, what is actually wrong, and what to do in what order.
  3. Export evidence โ†’ Download all โ€” three artifacts:
    • JSON โ€” the full result pack: summary + grade, coverage, insights, ranked recommendations, action plan, and every control with status and evidence. Commit it, diff the next run, gate CI with cinch assess --fail-on critical.
    • CSV โ€” the gap register, one row per control, with remediation phase and rank, for tickets and trackers.
    • PDF โ€” printable report: grade and why it was capped, insights, action plan, recommendations, CUSTODY coverage, open gaps, NIST AI RMF crosswalk.

๐Ÿš€ Quick start for AI agents

You are an AI agent reading this repo. This section is for you. Three commands and one config block get you operational.

1. Install

pip install cinch-ai-security
# or, from source:
git clone https://github.com/nirhalfon/cinch-ai-security.git
cd cinch-ai-security && pip install -e .

2. Wire it into your MCP client

Add this to your MCP config (Claude Desktop, Claude Code, Cursor, etc.):

{
  "mcpServers": {
    "cinch": {
      "command": "cinch",
      "args": ["serve"]
    }
  }
}

3. Query the controls you need

Your tools (all return JSON):

Tool Use it to
evidence_collect Probe a running deployment (host / project / endpoint) and get an evidence bundle
evidence_verify Grade an evidence bundle โ†’ score, grade, insights, recommendations, action plan
checklist_run Run a named checklist against a description of your deployment
checklist_list List the 6 checklists and their item counts
checklist_get Get a specific control by ID (AC-001, AE-005, โ€ฆ)
protocol_get Get a step-by-step protocol by name (agent-deployment, evidence-collect, โ€ฆ)
mapping_lookup Look up controls mapped to a framework (nist-rmf, owasp-llm, atlas, custody, lasm)
threat_search Find every control that mitigates a given threat โ€” scans threat + control + verification + sources
checklist_diff Compare two checklists to surface coverage gaps and duplicated controls

Checklist ID prefixes: AC agent-containment ยท AE agent-environment ยท HE harness-engineering ยท RT red-team ยท SC supply-chain ยท SH system-hardening.

30-second smoke test

cinch serve &            # start the MCP server on stdio
# then call checklist_list from your MCP client, or:
python -c "from cinch.loader import list_checklists; [print(c['name'], c['item_count']) for c in list_checklists()]"

CLI reference

Command What it does
cinch serve Run the MCP server over stdio (the default with no subcommand)
cinch console Serve the assessment console on localhost (--port, --host, --no-browser, --assessment)
cinch collect Probe a running agent โ†’ evidence bundle (--host, --pid, --unit, --project, --endpoint, --authorized, --sign-cmd, --out)
cinch verify Grade an evidence bundle (--evidence, --out, --fail-on critical|high|any-gap)
cinch assess Grade a hand-reviewed state file (--state, --out, --deployment, --fail-on)

Use as a skill (Hermes / Claude / OpenClaw / NanoClaw)

# Hermes skill
cp -r skills/ai-harness-review ~/.hermes/skills/

# Claude Code โ€” drop into your project root; it auto-loads
cp cross-harness/claude/CLAUDE.md /your/project/CLAUDE.md

# OpenClaw / NanoClaw โ€” see cross-harness/openclaw/ and cross-harness/nanoclaw/

๐Ÿงญ Philosophy

  1. The model proposes; the architecture authorizes and enforces. Prompts are not a security boundary.
  2. An AI agent can be manipulated, compromised, or wrong. Its environment must prevent a bad decision from becoming an unrestricted system action.
  3. Functional correctness โ‰  security. 47.5% of AI-generated code may be functionally correct, but only 8.25% is also secure (ICLR 2026 vibe-coding benchmark).
  4. Capability accretion is the core risk. Agents silently gain practical authority through inherited credentials, trust relationships, tool access, and delegation chains.
  5. Defense in depth maps to architecture layers. A control at one layer does not detect an attack at another (LASM principle).

๐Ÿ“š Project structure

cinch/
โ”œโ”€โ”€ src/cinch/                      # MCP server (SDK 2.0)
โ”‚   โ”œโ”€โ”€ server.py                   # 9 tool definitions + CLI (serve / console / collect / verify / assess)
โ”‚   โ”œโ”€โ”€ probes/                     # observe a running agent
โ”‚   โ”‚   โ”œโ”€โ”€ host.py                 # AE-001..AE-011 from /proc, cgroups, netfilter, mountinfo
โ”‚   โ”‚   โ”œโ”€โ”€ project.py              # MCP grants, manifests, CI, pinning, secrets (HE/SC/AC)
โ”‚   โ”‚   โ””โ”€โ”€ behaviour.py            # injection / leakage / tool / rate probes (authorization-gated)
โ”‚   โ”œโ”€โ”€ collect.py                  # evidence bundle: provenance, self-audit detection, signing
โ”‚   โ”œโ”€โ”€ verify.py                   # bundle โ†’ graded assessment (unknown never becomes a pass)
โ”‚   โ”œโ”€โ”€ assess.py                   # assessment engine: score, grade, insights, recommendations, plan
โ”‚   โ”œโ”€โ”€ console.py                  # localhost static server for the assessment console
โ”‚   โ””โ”€โ”€ loader.py                   # YAML checklist/protocol/mapping loader (path-traversal-safe)
โ”œโ”€โ”€ checklists/                     # 6 checklists ยท 117 controls
โ”‚   โ”œโ”€โ”€ agent-containment.yaml      # CUSTODY-based agent containment (AC)
โ”‚   โ”œโ”€โ”€ agent-environment.yaml      # host/container controls, out-of-band audited (AE)
โ”‚   โ”œโ”€โ”€ harness-engineering.yaml    # AI dev harness safeguards (HE)
โ”‚   โ”œโ”€โ”€ system-hardening.yaml       # OS/infra hardening for AI workloads (SH)
โ”‚   โ”œโ”€โ”€ red-team.yaml               # AI red team engagement checklist (RT)
โ”‚   โ””โ”€โ”€ supply-chain.yaml           # AI supply chain security (SC)
โ”œโ”€โ”€ protocols/                      # 5 how-to procedures
โ”‚   โ”œโ”€โ”€ agent-deployment.md
โ”‚   โ”œโ”€โ”€ evidence-collect.md         # out-of-band signed-JSON host evidence for AE controls
โ”‚   โ”œโ”€โ”€ incident-response.md
โ”‚   โ”œโ”€โ”€ red-team-engagement.md
โ”‚   โ””โ”€โ”€ harness-setup.md
โ”œโ”€โ”€ skills/                         # 3 Hermes skills
โ”‚   โ”œโ”€โ”€ ai-harness-review/SKILL.md
โ”‚   โ”œโ”€โ”€ agent-audit/SKILL.md        # + separation-of-duties / --self-audit rule
โ”‚   โ””โ”€โ”€ ai-red-team/SKILL.md
โ”œโ”€โ”€ mappings/                       # 5 framework crosswalks
โ”‚   โ”œโ”€โ”€ nist-rmf-crosswalk.yaml
โ”‚   โ”œโ”€โ”€ owasp-llm-crosswalk.yaml
โ”‚   โ”œโ”€โ”€ atlas-crosswalk.yaml
โ”‚   โ”œโ”€โ”€ custody-crosswalk.yaml
โ”‚   โ””โ”€โ”€ lasm-crosswalk.yaml
โ”œโ”€โ”€ cross-harness/                  # agent platform configs
โ”‚   โ”œโ”€โ”€ claude/CLAUDE.md
โ”‚   โ”œโ”€โ”€ openclaw/agent-config.yaml
โ”‚   โ””โ”€โ”€ nanoclaw/agent-config.yaml
โ”œโ”€โ”€ templates/                      # 4 review/policy/ADR templates
โ”œโ”€โ”€ docs/                           # threat-model, research-references, design-rationale
โ”œโ”€โ”€ marketing/                      # announcement copy (kept out of docs/ โ€” docs/ is bundled)
โ”œโ”€โ”€ docs-site/                      # the console
โ”‚   โ”œโ”€โ”€ index.html                  # landing page + assessment dashboard (one file)
โ”‚   โ””โ”€โ”€ data/
โ”‚       โ”œโ”€โ”€ full.json               # generated control catalog
โ”‚       โ”œโ”€โ”€ rubric.json             # scoring rules โ€” shared with src/cinch/assess.py
โ”‚       โ””โ”€โ”€ assessment.json         # generated result pack the console opens on
โ”œโ”€โ”€ examples/assessment-state.json  # worked assessment state (input to `cinch assess`)
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ build_docs_json.py          # deterministic full.json generator (run on every source change)
โ”‚   โ”œโ”€โ”€ build_assessment.py         # regenerate docs-site/data/assessment.json
โ”‚   โ””โ”€โ”€ migrate_schema.py           # one-time Schema B โ†’ canonical Schema A migration
โ”œโ”€โ”€ tests/                          # pytest: loader, server, console, assessment engine, probes
โ””โ”€โ”€ .github/
    โ”œโ”€โ”€ dependabot.yml              # weekly pip + github-actions updates
    โ””โ”€โ”€ workflows/
        โ”œโ”€โ”€ validate.yaml           # CI: YAML, imports, ruff, bandit, pip-audit, content gate, pytest, full.json sync
        โ”œโ”€โ”€ security-scan.yml       # CodeQL, semgrep, dependency-review, gitleaks, SBOM
        โ””โ”€โ”€ pages.yml               # deploy the console to GitHub Pages

๐Ÿ”ฌ Research grounding

Source Coverage
NIST AI RMF 1.0 Risk governance (GOVERN, MAP, MEASURE, MANAGE)
NIST AI 600-1 GenAI Profile Generative AI-specific risks and controls
CISA Secure AI System Development Secure AI lifecycle controls
OWASP Top 10 for LLMs LLM application security risks
OWASP Agentic AI Agent threat modeling and controls
MITRE ATLAS Adversarial threat landscape for AI
CUSTODY Framework Autonomous agent containment
LASM Layered Attack Surface Model
Google SAIF Secure AI Framework
CSA AICM AI Controls Matrix
ETSI SAI AI cybersecurity standardization
AI Harness Scorecard Engineering safeguards for AI-assisted dev
DORA 2025 CI/CD practices, stability metrics
SlopCodeBench Subtle correctness in AI-generated code

๐Ÿค Contributing

See CONTRIBUTING.md. Every checklist item, protocol step, and mapping must cite a source. After any source change, regenerate both generated files โ€” CI verifies they are in sync:

python scripts/build_docs_json.py    # docs-site/data/full.json     (control catalog)
python scripts/build_assessment.py   # docs-site/data/assessment.json (result pack the console opens on)

๐Ÿ”’ Security

See SECURITY.md for vulnerability reporting. This project dogfoods its own controls โ€” the repo itself is scanned with CodeQL, semgrep, bandit, pip-audit, and gitleaks on every push.

๐Ÿ“„ License

CC BY 4.0 โ€” free to share and adapt with attribution.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cinch_ai_security-1.1.1.tar.gz (243.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cinch_ai_security-1.1.1-py3-none-any.whl (220.0 kB view details)

Uploaded Python 3

File details

Details for the file cinch_ai_security-1.1.1.tar.gz.

File metadata

  • Download URL: cinch_ai_security-1.1.1.tar.gz
  • Upload date:
  • Size: 243.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cinch_ai_security-1.1.1.tar.gz
Algorithm Hash digest
SHA256 115dab722268d3c09799afcb5429d270be5bd88aad328d4795dc29356b583f39
MD5 3f578f75afe4b65cdae7a04754709cb3
BLAKE2b-256 e40273ef87c00291015a723bff4fb686e1d82e980155df2f3be356e64e23a54a

See more details on using hashes here.

Provenance

The following attestation bundles were made for cinch_ai_security-1.1.1.tar.gz:

Publisher: release.yml on nirhalfon/cinch-ai-security

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cinch_ai_security-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for cinch_ai_security-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 efa224e71e41f749799f8caa6347cdfd40eb999476aef08b93944341beb2864b
MD5 76bbfa253d296ca447686d7e85cc3de6
BLAKE2b-256 483357b43a152de77e701ed65d600a9d3e8ff2c659de86327ff33e6cc570978a

See more details on using hashes here.

Provenance

The following attestation bundles were made for cinch_ai_security-1.1.1-py3-none-any.whl:

Publisher: release.yml on nirhalfon/cinch-ai-security

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page