{
  "slug": "ai-coding-assistants",
  "topic": "AI coding assistants",
  "status": "published",
  "order": 46,
  "capability": "ai/coding-assistants",
  "title": "AI coding assistants: what can your agents reach and run?",
  "short": "Use company accounts, require the sandbox with bypass modes off, and have a second person approve every agent pull request.",
  "answer": "This month, move every developer to a company account, require the tool's sandbox with bypass modes switched off in managed settings, and keep production credentials away from agents. Judge every new tool, MCP server or automation by what outsiders can write into what it reads, and what it could run, reach or merge if that text took over.",
  "audience": "Engineering leads, platform and security teams whose developers use AI coding assistants and agents",
  "version": "1.2",
  "lastReviewed": "2026-11-05",
  "reviewEveryDays": 30,
  "blocks": [
    {
      "type": "ranked",
      "id": "first",
      "title": "If you only do five things",
      "navTitle": "Five things",
      "items": [
        {
          "title": "Move everyone to company accounts.",
          "text": "Since 24 April 2026, GitHub trains on Copilot Free, Pro, Pro+ and Max interactions by default, not on Business or Enterprise[^ghpub]. Block `*.individual.githubcopilot.com` at the firewall[^ghnet]."
        },
        {
          "title": "Keep production credentials away from agents.",
          "text": "Agent commands run with the developer's credentials[^vscsec]. In April 2026 an agent found an account-scoped Railway token on a developer's machine and deleted a production database volume with it[^railway]. Hand out scoped, non-production tokens."
        },
        {
          "title": "Require the sandbox and block bypass modes.",
          "text": "Claude Code's sandbox is off by default and still reads `~/.ssh` unless you deny it[^ccsandbox]. Require it in managed settings, set `disableBypassPermissionsMode` in Claude Code and Copilot[^ccmodes][^ghms] and keep yolo modes for offline throwaway containers[^ccmodes]."
        },
        {
          "title": "Treat inputs as instructions from their authors.",
          "text": "Issues, pull requests, docs and config files can all steer an agent. Cline's triage agent had a shell and read any GitHub user's issues, which exposed its publishing credentials; an npm token Cline failed to rotate let an outsider publish a release[^cline]. Agents that read outsiders' text get no shell and no secrets."
        },
        {
          "title": "Have a second person approve every agent change.",
          "text": "Copilot cloud agent can't approve its own pull requests, nor can the person who asked, and workflows wait for a human by default[^ghrisks]. Local agents push as the developer[^vscsec], so require approval of the latest push by someone else, as in the secure development sheet."
        }
      ]
    },
    {
      "type": "steps",
      "id": "rollout",
      "title": "Roll out an assistant or agent to a team",
      "navTitle": "Rollout",
      "items": [
        {
          "title": "Settle plans and data terms first.",
          "text": "Choose business plans that don't train on your code, check retention options and sign the processor contract the AI inputs sheet describes. Where licensing matters, block **Suggestions matching public code**, which only IDEs fully enforce[^ghsurf]."
        },
        {
          "title": "Write managed settings per tool.",
          "text": "Require the sandbox, in Claude Code with `failIfUnavailable` and `allowUnsandboxedCommands: false`, which needs macOS, Linux or WSL2[^ccsandbox], disable bypass modes and allowlist MCP servers[^ghms]. Push them so developers can't weaken them[^ghsandbox]."
        },
        {
          "title": "Move unattended work off laptops.",
          "text": "Run long autonomous tasks in the vendor's cloud sandbox or a container. Copilot cloud agent pushes to one branch only and works behind a firewall[^ghrisks], which covers only processes its Bash tool starts, not MCP servers, and can be bypassed[^ghfw]."
        },
        {
          "title": "Protect the files that steer the agent.",
          "text": "Put `AGENTS.md`, `CLAUDE.md`, `.mcp.json` and the `.github`, `.vscode`, `.cursor`, `.claude` and `.gemini` folders under CODEOWNERS with **Require review from Code Owners**, as GitHub advises for its own agent files[^ghguard]."
        },
        {
          "title": "Turn on logs before the first agent pull request.",
          "text": "GitHub's audit log keeps agent events under `actor:Copilot` for 180 days, but no local prompts[^ghaudit]; Claude Code exports tool decisions over OpenTelemetry[^ccotel]. In Germany, agree this with the works council, which co-determines monitoring tools[^betrvg]."
        }
      ]
    },
    {
      "type": "list",
      "id": "defaults",
      "title": "Gaps that catch teams out",
      "navTitle": "Gaps",
      "items": [
        "**VS Code's agent sandbox leaves the network open.** Outbound access stays on by default, so restrict it separately[^vscsec].",
        "**Headless runs trust the repository.** `claude -p` runs its hooks and `.mcp.json` servers unasked; use `--setting-sources user` on code you didn't write[^ccperm]. Gemini CLI in CI trusted a pull request's `.gemini/` until April 2026, a CVSS 10 flaw[^gemadv].",
        "**Ignore files and deny rules leak.** Copilot content exclusion skips symlinks and may miss indirect access[^ghexcl]; Claude Code's `Read` deny rules miss scripts that open files[^ccperm]. Keep secrets out of the repository.",
        "**Cursor trusts every workspace.** Workspace trust is off by default; enforce `security.workspace.trust.enabled` through MDM[^cursorsec]."
      ]
    },
    {
      "type": "list",
      "id": "review",
      "title": "Reviewing what agents write and install",
      "navTitle": "Review",
      "items": [
        "**Working code can be exploitable.** If the prompt skipped security, 35% of working backends by BaxBench's top model, Claude Opus 4.5, were exploitable[^baxbench]. Keep agent pull requests behind the same CI gates.",
        "**Check that every new package is real.** In a 2025 study, 19.7% of packages in code from 16 early-2024 models didn't exist, and 43% of those recurred in all 10 repeats of a prompt[^usenix]. Check a new dependency's history first.",
        "**Pin MCP servers.** The fake `postmark-mcp` built trust over 15 versions before 1.0.16 secretly BCC'd emails to an outside server[^postmark]. Allowlist servers in managed settings[^ghms] and pin versions."
      ]
    },
    {
      "type": "list",
      "id": "changed",
      "title": "What changed in 2026",
      "navTitle": "What changed",
      "span": "full",
      "items": [
        "**Copilot offers EU data residency** since April[^ghresnew], on Enterprise Cloud with data residency, off by default and at 10% more AI credits[^ghresidency].",
        "**GitHub can require local sandboxing** for Copilot, generally available since 7 October, with policies developers can't weaken[^ghsandbox].",
        "**Copilot's approval can count toward required approvals** since 28 October, if admins allow it[^ghcrapprove]. Keep it off where agents open pull requests.",
        "**Claude Code starts in auto mode** from v2.1.283, with a classifier reviewing actions; `permissions.disableAutoMode` turns it off[^ccmodes]."
      ]
    },
    {
      "type": "list",
      "id": "skip",
      "title": "What you can skip",
      "items": [
        "**Banning assistants outright.** It pushes developers to private accounts you can't see. The BSI and ANSSI advise offering approved tools with clear rules instead[^bsiaica].",
        "**Security rules in `AGENTS.md` or `CLAUDE.md`.** Instructions guide the model and are not an enforcement boundary[^vscsec]. Back each rule with a setting.",
        "**Hand-tuned command allowlists.** Auto-approval rules parse commands on a best-effort basis, and aliases or quote tricks can slip past them[^vscsec]. A sandbox does more for less upkeep.",
        "**Ranking models by how secure their code is.** Even the top model on BaxBench writes exploitable code[^baxbench]. Put the effort into CI gates and review."
      ]
    },
    {
      "type": "list",
      "id": "mistakes",
      "title": "Mistakes that cost the most",
      "navTitle": "Mistakes",
      "items": [
        "**Giving a CI agent a shell and outsiders' text.** Cline calls that \"functionally equivalent to giving every GitHub user shell access\"[^cline].",
        "**Letting a classifier approve risky work.** Anthropic says auto mode doesn't guarantee safety or replace review of sensitive operations[^ccmodes]. Add `ask` rules for deploys, migrations and pushes, such as `Bash(git push *)`, knowing they miss rewritten commands[^ccperm].",
        "**Skipping workflow approval on agent pull requests.** Admins can let workflows run on Copilot's pull requests without a human[^ghrisks]. Keep the approval, as for outside contributors.",
        "**Putting deployment secrets in Agents secrets.** Copilot can read those. Keep what it shouldn't touch in Actions secrets, which it can't[^ghguard].",
        "**Yolo mode in a container with secrets.** A malicious project can then take anything inside, including the agent's credentials[^codex]."
      ]
    },
    {
      "type": "columns",
      "id": "by-size",
      "title": "What this looks like at your size",
      "navTitle": "By team size",
      "span": "full",
      "columns": [
        {
          "title": "Small team, no security staff",
          "items": [
            "Buy the business plan of one assistant and keep company code out of personal accounts.",
            "Require the sandbox and block bypass modes centrally, as Claude Code's server-managed settings on claude.ai allow without MDM[^ccsandbox]. Run autonomous tasks in the vendor's cloud agent, not in yolo mode on a laptop.",
            "Keep production tokens off developer laptops."
          ]
        },
        {
          "title": "Growing, with IT or security staff",
          "items": [
            "Push managed settings by MDM: sandbox required, bypass disabled, MCP allowlist, deny rules for secret paths.",
            "Stream the GitHub audit log and agent telemetry to your SIEM.",
            "Alert on permission mode changes and new MCP servers."
          ]
        },
        {
          "title": "Enterprise or regulated",
          "items": [
            "Turn on EU data residency or zero retention where offered, and record the tools in your DPIA.",
            "Run unattended agents only in cloud sandboxes or ephemeral runners with an egress allowlist and short-lived credentials.",
            "Red-team agent workflows with poisoned issues and pull requests before granting write access.",
            "Grow AppSec and review capacity with agent output, as the BSI and ANSSI advise[^bsiaica]."
          ]
        }
      ]
    }
  ],
  "changes": [
    {
      "date": "2026-11-05",
      "version": "1.2",
      "text": "Added that the Copilot cloud agent's firewall covers only processes its Bash tool starts, not MCP servers, and can be bypassed."
    },
    {
      "date": "2026-11-05",
      "version": "1.1",
      "text": "Reviewed for company readers: small teams now require the sandbox and block bypass modes centrally, through Claude Code's server-managed settings, instead of relying on each developer's settings."
    },
    {
      "date": "2026-11-05",
      "version": "1.0",
      "text": "Published after a copy edit and a source-by-source fact check, which updated Copilot's training plans and code review approvals to GitHub's current docs, noted where the public code filter applies and recomputed the BaxBench figure from the leaderboard data."
    },
    {
      "date": "2026-11-05",
      "version": "0.1",
      "text": "First draft, based on GitHub, Anthropic and VS Code documentation, the BSI and ANSSI guidance on AI coding assistants, the USENIX Security 2025 package hallucination study, BaxBench and incident reports from Cline, Railway, Postmark and Gemini CLI."
    }
  ],
  "sources": [
    {
      "id": "ghpub",
      "title": "Managing GitHub Copilot policies as an individual subscriber",
      "publisher": "GitHub Docs",
      "date": "checked 5 Nov 2026",
      "url": "https://docs.github.com/en/copilot/how-tos/manage-your-account/manage-policies"
    },
    {
      "id": "ghnet",
      "title": "Managing GitHub Copilot access to your enterprise's network",
      "publisher": "GitHub Docs",
      "date": "checked 5 Nov 2026",
      "url": "https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-access/manage-network-access"
    },
    {
      "id": "bsiaica",
      "title": "AI Coding Assistants",
      "publisher": "ANSSI and BSI",
      "date": "Sep 2024",
      "url": "https://www.bsi.bund.de/SharedDocs/Downloads/EN/BSI/KI/ANSSI_BSI_AI_Coding_Assistants.pdf"
    },
    {
      "id": "vscsec",
      "title": "Secure AI-assisted development in VS Code",
      "publisher": "VS Code Docs",
      "date": "checked 5 Nov 2026",
      "url": "https://code.visualstudio.com/docs/agents/run/security"
    },
    {
      "id": "railway",
      "title": "Your AI wants to nuke your database. Guardrails fix that",
      "publisher": "Railway",
      "date": "29 Apr 2026",
      "url": "https://blog.railway.com/p/your-ai-wants-to-nuke-your-database"
    },
    {
      "id": "ccsandbox",
      "title": "Claude Code: Configure the sandboxed Bash tool",
      "publisher": "Anthropic",
      "date": "checked 5 Nov 2026",
      "url": "https://code.claude.com/docs/en/sandboxing"
    },
    {
      "id": "ccmodes",
      "title": "Claude Code: Choose a permission mode",
      "publisher": "Anthropic",
      "date": "checked 5 Nov 2026",
      "url": "https://code.claude.com/docs/en/permission-modes"
    },
    {
      "id": "ghms",
      "title": "Enterprise managed settings (Copilot)",
      "publisher": "GitHub Docs",
      "date": "checked 5 Nov 2026",
      "url": "https://docs.github.com/en/copilot/reference/enterprise-administrators/enterprise-managed-settings"
    },
    {
      "id": "cline",
      "title": "Post-mortem: Unauthorized Cline CLI npm publish on February 17, 2026",
      "publisher": "Cline",
      "date": "24 Feb 2026",
      "url": "https://cline.bot/blog/post-mortem-unauthorized-cline-cli-npm"
    },
    {
      "id": "ghrisks",
      "title": "Risks and mitigations for GitHub Copilot cloud agent",
      "publisher": "GitHub Docs",
      "date": "checked 5 Nov 2026",
      "url": "https://docs.github.com/en/copilot/concepts/security-governance-and-network-settings/risks-and-mitigations"
    },
    {
      "id": "ghfw",
      "title": "Customizing or disabling the firewall for GitHub Copilot",
      "publisher": "GitHub Docs",
      "date": "checked 5 Nov 2026",
      "url": "https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-the-firewall"
    },
    {
      "id": "ghsandbox",
      "title": "Local sandboxing for GitHub Copilot now generally available",
      "publisher": "GitHub Changelog",
      "date": "7 Oct 2026",
      "url": "https://github.blog/changelog/2026-10-07-local-sandboxing-for-github-copilot-now-generally-available/"
    },
    {
      "id": "ghguard",
      "title": "Building a secure cloud environment for agents in your enterprise",
      "publisher": "GitHub Docs",
      "date": "checked 5 Nov 2026",
      "url": "https://docs.github.com/en/copilot/tutorials/cloud-agent/build-guardrails"
    },
    {
      "id": "ghaudit",
      "title": "Reviewing audit logs for GitHub Copilot",
      "publisher": "GitHub Docs",
      "date": "checked 5 Nov 2026",
      "url": "https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-for-enterprise/review-audit-logs"
    },
    {
      "id": "ccotel",
      "title": "Claude Code: Monitoring",
      "publisher": "Anthropic",
      "date": "checked 5 Nov 2026",
      "url": "https://code.claude.com/docs/en/monitoring-usage"
    },
    {
      "id": "betrvg",
      "title": "Works Constitution Act (BetrVG), section 87(1)",
      "publisher": "Gesetze im Internet",
      "date": "checked 5 Nov 2026",
      "url": "https://www.gesetze-im-internet.de/englisch_betrvg/englisch_betrvg.html"
    },
    {
      "id": "ccperm",
      "title": "Claude Code: Configure permissions",
      "publisher": "Anthropic",
      "date": "checked 5 Nov 2026",
      "url": "https://code.claude.com/docs/en/permissions"
    },
    {
      "id": "gemadv",
      "title": "Gemini CLI: Remote Code Execution via workspace trust and tool allowlisting bypasses",
      "publisher": "GitHub Advisory Database",
      "date": "24 Apr 2026",
      "url": "https://github.com/advisories/GHSA-wpqr-6v78-jr5g"
    },
    {
      "id": "ghexcl",
      "title": "Content exclusion for GitHub Copilot",
      "publisher": "GitHub Docs",
      "date": "checked 5 Nov 2026",
      "url": "https://docs.github.com/en/copilot/concepts/security-governance-and-network-settings/content-exclusion"
    },
    {
      "id": "cursorsec",
      "title": "Agent Security",
      "publisher": "Cursor Docs",
      "date": "checked 5 Nov 2026",
      "url": "https://cursor.com/docs/agent/security"
    },
    {
      "id": "baxbench",
      "title": "BaxBench leaderboard (no security reminder)",
      "publisher": "ETH Zurich",
      "date": "checked 5 Nov 2026",
      "url": "https://baxbench.com/"
    },
    {
      "id": "usenix",
      "title": "We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs",
      "publisher": "USENIX Security",
      "date": "Aug 2025",
      "url": "https://www.usenix.org/conference/usenixsecurity25/presentation/spracklen"
    },
    {
      "id": "postmark",
      "title": "Information regarding malicious \"postmark-mcp\" package",
      "publisher": "Postmark",
      "date": "25 Sep 2025",
      "url": "https://postmarkapp.com/blog/information-regarding-malicious-postmark-mcp-package"
    },
    {
      "id": "ghresnew",
      "title": "Data residency (US + EU) and FedRAMP-authorized models now available in Copilot",
      "publisher": "GitHub Changelog",
      "date": "13 Apr 2026",
      "url": "https://github.blog/changelog/2026-04-13-copilot-data-residency-in-us-eu-and-fedramp-compliance-now-available/"
    },
    {
      "id": "ghresidency",
      "title": "GitHub Copilot with data residency",
      "publisher": "GitHub Docs",
      "date": "checked 5 Nov 2026",
      "url": "https://docs.github.com/en/enterprise-cloud@latest/admin/data-residency/github-copilot-with-data-residency"
    },
    {
      "id": "ghcrapprove",
      "title": "Copilot code review: Merge with confidence with Max and approvals",
      "publisher": "GitHub Changelog",
      "date": "28 Oct 2026",
      "url": "https://github.blog/changelog/2026-10-28-copilot-code-review-merge-with-confidence-with-max-and-approvals/"
    },
    {
      "id": "codex",
      "title": "Agent approvals and security (Codex)",
      "publisher": "OpenAI",
      "date": "checked 5 Nov 2026",
      "url": "https://learn.chatgpt.com/docs/agent-approvals-security"
    },
    {
      "id": "ghsurf",
      "title": "Supported surfaces for GitHub Copilot policies",
      "publisher": "GitHub Docs",
      "date": "checked 5 Nov 2026",
      "url": "https://docs.github.com/en/copilot/reference/supported-surfaces-for-policies"
    }
  ]
}