{"slug": "show-hn-policy-enforcement-for-claude-code-cursor-and-codex", "title": "Show HN: Policy enforcement for Claude Code, Cursor, and Codex", "summary": "Kastra, a runtime authorization tool for AI coding agents like Claude Code, Cursor, and Codex, intercepts agent tool calls and evaluates them against deterministic policies before execution. The tool was created after a Cursor agent nearly executed a destructive database command, highlighting the lack of guardrails in existing setups. Kastra provides an allow/hold/deny decision system, policy packs, and an immutable audit trail, with a free tier for developers.", "body_md": "Show HN: Runtime authorization for Claude Code, Cursor, and Codex\n\nHi HN, Fernando and I built Kastra. Kastra intercepts AI agent tool calls and evaluates them against deterministic policies before they execute. This is aimed at developers using coding agents like Claude Code, Codex, Cursor, and OpenClaw.\n\nWe built Kastra after one of our Cursor agents almost executed DELETE FROM customers WHERE status='test' against a production database. We caught it before it ran, but it made us realize that nothing in our stack actually decided what the agent was allowed to do. What mattered for us wasn't the mistake; it was realizing nothing in our setup would have stopped it if we weren't actively on top of it. LLMs are probabilistic, and prompts influence behavior, but they don't deterministically decide what an agent is allowed to do. Without a deterministic policy system, nothing could have decided what it was allowed to do.\n\nKastra pushes an allow, hold, and deny decision before the action runs. You can build these policies in plain English from the web app. The interception engine evaluates the tools, targets, and parameters of every action. We also shipped many policy packs covering common high-risk scenarios, and every decision is recorded in an immutable audit trail. The desktop app, CLI, dashboard, and Recon scan are free to use for developers.\n\nIf you often use Claude, Codex, Openclaw, and Cursor, Kastra can run a scan command on which risky actions your agents have already taken and automatically build rules to avoid them from happening again. Recon is a feature of Kastra that scans your local agent history. In order to run this scan, execute the commands below in your coding agent.\n\nbrew install kastra-labs/tap/kastra-edge\n\nkastra-edge scan\n\nThe scan reads your local agent session history, and it shows all the risky actions your agent has already taken before, the secrets written to tracked files, production databases touched, force pushes, curl-to-shell, and more. This runs on your machine, and secrets never leave. In our own use cases, we kept finding things we'd forgotten or didnt know agents had done.\n\nEach finding can be converted into a runtime policy, letting you delegate more work to AI without trusting the model itself. Kastra intercepts all workloads at runtime and makes sure these policy evaluations typically complete in under a millisecond. Instead of trusting the model, you trust the deterministic rules that govern its actions.\n\nOne problem we are still working on to improve the stack is how to manage teams of agents with conflicting policies. We would love feedback from anyone building multi-agent systems. Fernando and I will be reviewing the comments. We are super curious what your first scan finds. Please post results below so we can see what the most common patterns are and adjust policy packs for our users based on your feedback.\n\nDocumentation:\n[https://kastra.ai/docs](https://kastra.ai/docs)\n\nDownload for MacOS Kastra Edge:\n[https://kastra.ai/edge/download.html](https://kastra.ai/edge/download.html)\n\nCheck Kastra in action today:\n[https://www.youtube.com/watch?v=6TUETu5lb3Q&feature=youtu.be](https://www.youtube.com/watch?v=6TUETu5lb3Q&feature=youtu.be)\n\nComments URL: [https://news.ycombinator.com/item?id=48847526](https://news.ycombinator.com/item?id=48847526)\n\nPoints: 4\n\n# Comments: 0", "url": "https://wpnews.pro/news/show-hn-policy-enforcement-for-claude-code-cursor-and-codex", "canonical_source": "https://kastra.ai/", "published_at": "2026-07-09 15:26:24+00:00", "updated_at": "2026-07-09 20:52:06.210493+00:00", "lang": "en", "topics": ["ai-agents", "ai-safety", "ai-tools", "developer-tools"], "entities": ["Kastra", "Claude Code", "Cursor", "Codex", "OpenClaw", "Fernando"], "alternates": {"html": "https://wpnews.pro/news/show-hn-policy-enforcement-for-claude-code-cursor-and-codex", "markdown": "https://wpnews.pro/news/show-hn-policy-enforcement-for-claude-code-cursor-and-codex.md", "text": "https://wpnews.pro/news/show-hn-policy-enforcement-for-claude-code-cursor-and-codex.txt", "jsonld": "https://wpnews.pro/news/show-hn-policy-enforcement-for-claude-code-cursor-and-codex.jsonld"}}