Minimal MCP guardrails proxy — policy-first, human approvals, hash-chained audit log.
Project description
A practical, readable AI agent guardrails framework —
and a working example of how agents should be governed.
Documentation · Quickstart · Repo Structure · Policies · Roadmap
🛡️ What is SHUGO?SHUGO is a guardrails-first framework for the agentic AI community. It helps teams define policies, approval gates, tool access, evaluation, observability, and incident response in one repo. It is designed to make AI agent behaviour bounded, visible, and accountable. Responsible AI should not live in a slide deck. It should live in the same repo as the agent — expressed as code, enforced at runtime, and producing evidence by default. |
📁 Repo Structure
|
A guardrail should not merely tell an agent what it should do.
The system should enforce what the agent is allowed to do.
🧱 Five Guardrail Layers
👤 Identity |
🗄️ Data |
🔧 Action |
🛡️ Safety |
🎖️ Governance |
| Verify who and what can act, with least privilege and strong authentication. | Control what data enters the agent and how context is handled. | Restrict tools, enforce policies, and require approvals for high-risk actions. | Detect, block, and recover from unsafe behaviour and system failures. | Audit, evaluate, and report to ensure accountability and continuous trust. |
| v0.1 · partial | v0.1 · partial | v0.1 · full | v0.1 · partial | v0.1 · full |
Layers ③ and ⑤ ship complete in v0.1. The others ship at the minimum depth needed to make those two credible, then deepen along the roadmap.
⚙️ How it works
SHUGO presents itself to your agent as a standard MCP server and sits between the agent and the tools it calls. Every tools/call is evaluated against a human-readable policy file before it reaches an upstream server. No protocol changes. No agent code changes.
┌──────────────┐ MCP ┌───────────┐ MCP ┌──────────────────┐
│ MCP client │ ───────▶ │ SHUGO │ ───────▶ │ Upstream MCP │
│ (any agent) │ ◀─────── │ guard │ ◀─────── │ servers (n) │
└──────────────┘ └─────┬─────┘ └──────────────────┘
│
┌───────────┼───────────┐
▼ ▼ ▼
guardrails audit log approval
.yaml (JSONL) channel
Works with Claude Desktop, Claude Code, Cursor, VS Code, and any framework with an MCP adapter — LangGraph, CrewAI, the OpenAI Agents SDK, n8n.
⚡ Quickstart
uvx shugo init # scaffold a policy from your existing MCP config
uvx shugo serve # start guarding
Point your MCP client at SHUGO instead of your servers:
{
"mcpServers": {
"shugo": {
"command": "uvx",
"args": ["shugo", "serve", "--config", "guardrails.yaml"]
}
}
}
Your agent now sees only the tools policy allows, blocks on anything needing approval, and writes an audit record for every call it makes.
📜 Policy as code
The most important file in the project. Design target: a risk lead can read it unaided, and a reviewer can diff it in a pull request.
version: "0.1"
defaults:
decision: deny # deny by default; allowlist upward
on_error: deny # fail closed
rules:
- id: read-only-github
match:
server: github
tool: ["get_*", "list_*", "search_*"]
decision: allow
- id: no-force-push
description: Force push can destroy history irrecoverably
match:
server: github
tool: push
args: { force: true }
decision: deny
reason: Force push is prohibited for autonomous agents.
controls: [OWASP-LLM06, NIST-AI-RMF-MANAGE-2.2]
- id: ticket-write-needs-approval
match:
server: tickets
tool: ["update_ticket", "close_ticket"]
decision: escalate
approval:
channel: cli
timeout_seconds: 300
on_timeout: deny
controls: [EU-AI-ACT-ART-14]
Deny by default. First match wins, top to bottom. Globs, not regex — readability is the constraint.
🧾 Evidence, not just logs
Enforcement without evidence is unauditable. Evidence without enforcement is theatre. SHUGO does both.
shugo evidence --framework owasp-llm --since 30d --out evidence/
Reads the audit log and produces a control-by-control bundle: which rules were in force, how often each fired, approval latency, exceptions, coverage gaps, and a hash-chain integrity check.
Framework mappings ship as data files sourced from public standards only — NIST AI RMF, EU AI Act, OWASP Top 10 for LLM Applications, and ISO/IEC 42001 control identifiers.
Scope note. SHUGO produces evidence about the guardrail layer. It does not certify an organisation as compliant with any standard.
🧰 CLI
| Command | Purpose |
|---|---|
shugo serve |
Run the guard proxy |
shugo init |
Scaffold a starter policy from installed MCP servers |
shugo validate |
Lint and schema-check the policy file |
shugo explain |
Dry-run a call — see which rule fires and why |
shugo audit tail / verify |
Inspect the log, verify the hash chain |
shugo evidence |
Generate an evidence bundle |
shugo halt |
Kill switch — deny all calls immediately |
🗺️ Roadmap
| Version | Theme |
|---|---|
| v0.1 | Guard proxy, policy engine, approvals, audit log, evidence packs |
| v0.2 | Layer ① depth — OAuth 2.1 / OIDC identity, per-principal policy, delegation scoping |
| v0.3 | Layer ② depth — retrieval boundaries, context filters, memory access rules |
| v0.4 | Layer ④ depth — injection detection, output validation, rollback |
| v0.5 | Layer ⑤ depth — policy regression suites, adversarial harness |
| v1.0 | Frozen policy schema, semantic versioning guarantee, plugin API |
🤝 Contributing
SHUGO is built in public, and the contribution ladder is deliberately low to the ground:
policy pack → scenario test → framework mapping → core
A new policy pack is a self-contained YAML file. You do not need to read the codebase to ship one. Start with CONTRIBUTING.md and the good first issues.
📄 License
Released under the MIT License. Use it, fork it, adapt it to your own agent architecture — that is the point.
守護 — shugo, to guard and protect.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shugo-0.1.0.tar.gz.
File metadata
- Download URL: shugo-0.1.0.tar.gz
- Upload date:
- Size: 28.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3e70f74d89ddd3dc9e49d89d000795c3e3575e5c0a27b7fd1cc69699fbe86d8
|
|
| MD5 |
f689e23aeb3ff41620f280d49499c29d
|
|
| BLAKE2b-256 |
956ed5d488317a0933aec94f7bb0e4ab14deb4f8a959c8a3159a957b277242a4
|
Provenance
The following attestation bundles were made for shugo-0.1.0.tar.gz:
Publisher:
release.yml on aritraghosh01/shugo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shugo-0.1.0.tar.gz -
Subject digest:
a3e70f74d89ddd3dc9e49d89d000795c3e3575e5c0a27b7fd1cc69699fbe86d8 - Sigstore transparency entry: 2291499244
- Sigstore integration time:
-
Permalink:
aritraghosh01/shugo@f049a39e5f6d31933fe85fa209f50f67808f8939 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/aritraghosh01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f049a39e5f6d31933fe85fa209f50f67808f8939 -
Trigger Event:
push
-
Statement type:
File details
Details for the file shugo-0.1.0-py3-none-any.whl.
File metadata
- Download URL: shugo-0.1.0-py3-none-any.whl
- Upload date:
- Size: 39.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1499710f97f9fcbd16a56f9765364b032b0cc1a5d5445fb383a67ee9f9dfddd
|
|
| MD5 |
7c3dc5313c547191f7291478d5ce37f3
|
|
| BLAKE2b-256 |
678d69a3966436d456385ddc69559aa8120208dad47dd96e7f201dc836ab03ff
|
Provenance
The following attestation bundles were made for shugo-0.1.0-py3-none-any.whl:
Publisher:
release.yml on aritraghosh01/shugo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shugo-0.1.0-py3-none-any.whl -
Subject digest:
b1499710f97f9fcbd16a56f9765364b032b0cc1a5d5445fb383a67ee9f9dfddd - Sigstore transparency entry: 2291499298
- Sigstore integration time:
-
Permalink:
aritraghosh01/shugo@f049a39e5f6d31933fe85fa209f50f67808f8939 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/aritraghosh01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f049a39e5f6d31933fe85fa209f50f67808f8939 -
Trigger Event:
push
-
Statement type: