{
  "id": 8234637,
  "title": "Put a permission gate on your AI agent in 5 minutes (MCP + Claude Code + CI)",
  "url": "https://urgent.news/2026/09/18/put-a-permission-gate-on-your-ai-agent-in-5-minutes-mcp-claude-code-ci",
  "topic": "ai",
  "section": "AI",
  "published": "2026-09-18T11:22:40.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/kunko_ai_labs/put-a-permission-gate-on-your-ai-agent-in-5-minutes-mcp-claude-code-ci-12ea"
  },
  "original_language": "en",
  "account": "Your AI agent's permissions may become unchecked over time. A malicious change, such as adding an MCP server with write access in a PR, or a .claude/settings.json file containing the \"allow: Bash(*)\" line, can slip through unnoticed despite thorough testing. To prevent this, implement a simple 5-minute gate using the agent-assurance framework.\n\nBegin by creating an agent-assurance.yaml file in your repository, outlining what your agent is allowed to do. For example, restrict capabilities to reading data, granting access only to internal data, and requiring human approval for any actions.\n\nNext, run a local scan using the agent-assurance command line tool. This will provide an overview of the blast radius, comparing the declared permissions with the observed behavior. Intentionally break the system by adding a write-capable MCP server, and the agent-assurance tool will highlight the discrepancy.\n\nIntegrate this gate into your CI pipeline. Add a GitHub workflow file (.github/workflows/agent-assurance.yml) with read permissions for the repository and write permissions for pull requests. The workflow should use the agent-assurance tool, comparing the agent-assurance.yaml configuration against the actual agent behavior with every push. If the agent's permissions deviate from the declared promise, the CI pipeline will flag the change with a red check, indicating a potential issue that requires review.\n\nFor releases, switch the mode to \"scan\" to perform a static analysis, checking for any suspicious SARIF findings or in-toto attestations. This ensures the agent's behavior aligns with the defined permissions and remains secure.\n\nThe agent-assurance framework provides deterministic results, offering a clear indication of whether the agent's permissions have drifted. It employs no network calls and does not rely on any secret values, ensuring a secure and reliable verification process. By enforcing this gate, you can confidently ensure the security of your AI agent in just five minutes.",
  "summary": "Your agent's permissions drift silently. A PR adds an MCP server with write scope, or allow: Bash(*) lands in .claude/settings.json while the runbook says \"a human approves\". Tests don't catch it. Linters don't catch it. Here's a 5-minute gate that does. Step 1: declare the promise Create agent-assurance.yaml in your repo — what the agent may do, in plain config: # agent-assurance.yaml…",
  "key_points": [
    "Implement agent-assurance.yaml to define agent permissions.",
    "Run local scan to compare declared and observed permissions.",
    "Integrate gate into CI pipeline for continuous security checks."
  ],
  "editors_take": null,
  "illustration": "https://urgent.news/ill/8234637.png",
  "coverage": {
    "outlets": 2,
    "also_reported_by": [
      {
        "outlet": "XDA Developers",
        "title": "I stopped giving Claude Code my entire project, and my Claude usage lasted 4x longer",
        "url": "https://urgent.news/2026/09/18/i-stopped-giving-claude-code-my-entire-project-and-my-claude-usage",
        "published": "2026-09-18T10:00:16.000Z"
      }
    ]
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}