{
  "markdown": "# Agent Guardrails Template\n\n> Safety rails for AI agents that write code. Set the boundaries once, let the agent run at full speed.\n\n[![Version](https://img.shields.io/badge/version-v3.7.1-blue.svg)](./CHANGELOG.md)\n[![Powered by Atlas Cloud](https://www.atlascloud.ai/oss-program/powered-by-atlas-cloud.svg)](https://www.atlascloud.ai/?ref=F6TYTG)\n[![Go](https://img.shields.io/badge/Go-1.25+-00ADD8?style=flat&logo=go&logoColor=white)](https://golang.org)\n[![License](https://img.shields.io/badge/License-BSD--3--Clause-blue.svg)](./LICENSE)\n[![Sponsor](https://img.shields.io/badge/Sponsor-TheArchitectit-FF69B4?style=flat&logo=github-sponsors)](https://github.com/sponsors/TheArchitectit)\n\n---\n\nIf you're letting AI agents write most of your code — and increasingly, you are — you need two things: clear boundaries so the agent knows what's allowed, and enforcement that's actually running when you're not watching. This repo gives you both.\n\nThe core is a **Go MCP server** that validates every bash command, file edit, and git operation against your rules before it runs. Around that, there's a full set of skills, IDE integrations, and workflows that get the guardrails into your actual development process without a lot of ceremony.\n\n## Quick Start\n\n```bash\ngit clone https://github.com/TheArchitectit/agent-guardrails-template.git\ncd agent-guardrails-template\ncp .env.example .env  # Fill in your API keys\ncd mcp-server && make compose-up\ncurl http://localhost:8081/health/ready\n```\n\nThat's it. The MCP server is live, the web dashboard is at `http://localhost:8081/web`, and the API explorer is at `http://localhost:8081/docs`.\n\nFor applying to an existing repo, see [how-to-apply.md](docs/getting-started/how-to-apply.md). For the 5-minute setup, see [quick-setup.md](docs/getting-started/quick-setup.md).\n\n## The Four Laws\n\nThese are the backbone. Everything else extends them.\n\n1. **Read before editing** — Never modify code without reading it first.\n2. **Stay in scope** — Only touch files explicitly authorized.\n3. **Verify before committing** — Test and check all changes.\n4. **Halt when uncertain** — Ask for clarification instead of guessing.\n\nSee [four-laws.md](skills/shared-prompts/four-laws.md) and [halt-conditions.md](skills/shared-prompts/halt-conditions.md) for the canonical prompts.\n\n## What's in the Box\n\n**MCP Server** (`mcp-server/`) — Go server with 37 tools, 11 resources, and a stateless StreamableHTTP transport (`POST /mcp`, no session management). Validates bash, file edits, git ops, and commits — and now defends against prompt injection, classifies content against an S1–S15 safety taxonomy, and sandboxes execution across L0–L2 levels. Backed by PostgreSQL 16 and Redis 7. Includes a web UI, OpenAPI 3.1 spec, and 31 REST endpoints including `/api/v1/policy/check` for CI/CD gating.\n\n**IDE Integrations** (`docs/integrations/`) — Native skills and rules for Claude Code, Cursor, OpenCode, Windsurf, and GitHub Copilot. Not generic prompts — each one is tailored to the platform's actual config format.\n\n**Skills** (`skills/shared-prompts/`) — Nine canonical shared prompts covering architecture, error recovery, scope validation, production-first thinking, and vibe coding. The same prompts work across every supported IDE.\n\n**Workflows** (`docs/workflows/`) — Twelve operational procedures: execution, escalation, code review, commit workflow, branch strategy, push safety, regression prevention, rollback, testing, and MCP checkpointing.\n\n**Standards** (`docs/standards/`) — Twenty-five engineering standards covering test/production separation, API specs, dependency governance, logging, rate limiting, retry/degradation, timeouts, operational circuit breakers, and prompting practices.\n\n**Examples** (`examples/`) — Fourteen languages: Go, TypeScript, Rust, Python, Java, Swift, Dart/Flutter, GDScript, Scala, R, C#, C++, PHP, and Ruby. Each demonstrates guardrails patterns in that language's idioms.\n\n## What's New in v3.7\n\nThrough the summer we closed the six \"2026 guardrail gaps\" — the places an AI coding agent could still slip past the rules. Each is a new subsystem in the MCP server, with a design spec under `docs/specs/guardrail-gaps-2026/`:\n\n- **Prompt injection defense (Spec 01)** — a four-layer pipeline (pattern → perplexity → classifier → LLM self-check) that catches injected instructions before they reach your agent, with per-source trust policies.\n- **Semantic content filtering (Spec 02)** — safety classification over an S1–S15 taxonomy (Llama Guard plus two code-specific categories), with policies, thresholds, and overrides per category or rule.\n- **Runtime sandbox isolation (Spec 03)** — three levels: L0 runs in-process, L1 uses `unshare` namespaces, L2 uses rootless podman/docker. CPU, memory, and PID limits, plus network isolation — and when `AllowedHosts` is set, L2 egress goes through a local proxy instead of the open network.\n- **Multi-agent safety policies (Spec 04)** — guardrails for when several agents work the same codebase: scan-and-block or scan-and-warn chains, constraint resolution, and validators for the Four Laws.\n- **Indirect injection / provenance (Spec 05)** — tracks where content came from, decodes obfuscated payloads (ROT13, base64), and decides how much to trust a source.\n- **Regulatory compliance mapping (Spec 06)** — a map from each guardrail feature to the frameworks it helps you satisfy (GDPR, SOC 2, ISO 27001, the EU AI Act, and more).\n\nBalancing all of that is the point: these guardrails run in the background so the agent can move at full speed and you can stop second-guessing everything it does.\n\n## Atlas Cloud (Sponsored)\n\nThis project is sponsored by [Atlas Cloud for Open Source](https://www.atlascloud.ai/?ref=F6TYTG) — $50/month in credits across 300+ image, video, audio, 3D, and LLM models. The guardrails' AI-backed checks (content-safety, AI advisors, output validation) can route through Atlas instead of pay-per-use endpoints. See [atlas-cloud.md](docs/integrations/atlas-cloud.md) for setup.\n\n## Project Structure\n\n```\nagent-guardrails-template/\n├── README.md                    ← You are here\n├── index-map.md                ← Keyword navigation (saves 60-80% tokens)\n├── CLAUDE.md                   ← Claude Code context\n├── CHANGELOG.md                ← Release history\n├── CONTRIBUTING.md             ← How to contribute\n├── docker-compose.yml          ← Local dev stack\n├── .github/FUNDING.yml         ← Sponsor this project\n├── docs/\n│   ├── getting-started/        ← Quick setup, apply guide, core rules\n│   ├── integrations/           ← Claude Code, Cursor, OpenCode, Windsurf, Copilot, Atlas\n│   ├── workflows/              ← 12 operational procedures\n│   ├── standards/              ← 25 engineering standards\n│   ├── ai-dev/                 ← AI-assisted dev patterns\n│   ├── security/               ← Security audit guides\n│   ├── enterprise/             ← Enterprise patterns\n│   ├── teams/                  ← Team management\n│   ├── accessibility/          ← WCAG 3.0+ compliance\n│   ├── spatial/                 ← XR/VR/AR patterns\n│   ├── ethical/                 ← Dark pattern prevention\n│   ├── monetization/            ← IAP and economy guardrails\n│   ├── multiplayer/             ← Chat moderation, fairness\n│   ├── analytics/               ← Consent and data minimization\n│   ├── deployment/              ← Cross-platform deployment\n│   ├── ui-ux/                   ← Component standards\n│   ├── advisors/                ← Cost, privacy, resilience\n│   ├── architecture/            ← Architecture decision records\n│   ├── rules/                   ← Rule definitions\n│   ├── state/                   ← State management patterns\n│   ├── generative/              ← Generative asset safety\n│   └── releases/               ← Release archive\n├── mcp-server/                 ← Go MCP server (PostgreSQL + Redis)\n├── pi-extension/                ← Pi coding agent extension\n├── examples/                    ← 14 language implementations\n├── skills/shared-prompts/      ← 9 canonical prompts\n├── scripts/                    ← Setup and utility tools\n├── tests/                      ← Test suite\n├── web/                        ← Web dashboard\n└── ci/                         ← CI/CD configuration\n```\n\nAll documents follow the **500-line max** rule for fast context loading. Use `index-map.md` for keyword-based navigation instead of reading the full tree.\n\n## Version\n\n**Current:** v3.7.1 (2026-08-23)\n\n| Version | Date | Highlights |\n|---------|------|------------|\n| **v3.7.1** | 2026-08-23 | README refresh covering the v3.7 guardrail subsystems |\n| **v3.7.0** | 2026-08-23 | Six guardrail subsystems, two QA passes, AllowedHosts egress filtering |\n| **v3.6.0** | 2026-08-22 | Atlas Cloud sponsorship integration, GitHub Sponsors, README rewrite |\n| **v3.5.0** | 2026-08-18 | Interactive bash permission prompts, danger allow-list, catastrophic type-back |\n| **v3.4.0** | 2026-08-15 | Documentation reorganization, game/vision content split to private repos |\n| **v3.3.0** | 2026-08-15 | Stateless StreamableHTTP transport, repo cleanup |\n| **v2.6.0** | 2026-02-15 | Python → Go migration complete |\n\nFull history in [CHANGELOG.md](CHANGELOG.md).\n\n## License\n\nBSD-3-Clause — see [LICENSE](LICENSE).\n\n[![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-TheArchitectit-FFDD00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/TheArchitectit)\n\n---\n\nBuilt by [TheArchitectit](https://github.com/TheArchitectit) with AI-assisted development.\n\n---\n\n#\n\n---\n\n## ☕ Support This Project\n\nIf this project helps you, consider [sponsoring on GitHub](https://github.com/sponsors/TheArchitectit). Every donation goes straight back into the work — GPU hardware and cloud compute for AI development, API credits for the agents that build and test these projects, and keeping everything free and open source. As a solo architect shipping on nights and weekends, even a small monthly sponsor makes a real difference.\n\nHelp keep this project going — use a referral link below and both of us get credits!\n\n| Service | Your Bonus | Details | Referral Code |\n| --------- | ----------- | --------- | --------------- |\n| [**Neuralwatt**](https://portal.neuralwatt.com/auth/register?ref=NW-ROGER-ET3Y) | $10 in credits | Spend $10+ → you get $10, we get $20 | `NW-ROGER-ET3Y` |\n| [**Synthetic**](https://synthetic.new/?referral=UAWqkKQQLFkzMkY) | $10 in credits | Subscribe → both get $10 credit | `UAWqkKQQLFkzMkY` |\n| [**Ozore**](https://ozore.com/?ref=cwe4kdx0) | 50% off first month | AI-ready cloud — code **lundrog50** | `lundrog50` |\n\n[![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-TheArchitectit-FFDD00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/TheArchitectit)\n",
  "bytes": 10820,
  "sha": "f41f2592c09826287bba0d9f9eb847a52274ba04e2e7ffbbb6b23ccfb59a301b",
  "repo_slug": "thearchitectit/agent-guardrails-template",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_thearchitectit_agent_guardrails_template_50fe8717/readme"
}