Safeguard
Security Guides•

What permissions should an AI coding agent get on a dev laptop?

A coding agent should start read only on a laptop, with write limited to the project and no production credentials. Here is a permission matrix to adapt.

Safeguard Security Team
4 min read

An AI coding agent on a developer laptop should start with read access to the project, write access limited to the working branch, command execution behind an allow list, no production credentials, and restricted network access. Widen permissions only when a specific task needs it, and narrow them again afterwards.

Why start small

OWASP lists excessive permissions as a root cause of agent harm: extensions with more access to downstream systems than the task requires. It also recommends granting the minimum permissions and running actions under the individual user's identity and scope. A laptop is a rich target because it holds many credentials at once, so the starting point should be conservative.

A matrix you can adapt

CapabilityLaptop defaultSandbox or devcontainerCI runner
Read project filesAllowedAllowedAllowed
Read files outside the projectDeniedDeniedDenied
Write filesProject only, working branchProject onlyProject only
Run shell commandsAllow list, ask for othersBroader allow listFixed steps only
Network accessPackage registry and git hostAllow listAllow list, no inbound
Cloud credentialsNoneShort lived, scopedShort lived, scoped
Push to default branchDeniedDeniedDenied
Install packagesAsk each timeAsk, then review diffLockfile only

The column matters as much as the row. The same action can be fine in a disposable container and risky on a laptop that holds a password manager session.

Steps to apply it

  1. Inventory the agent's current reach. Check which folders, shells, and network destinations it can use today. Most teams find broader access than they intended.
  2. Pick a default column for each user group. Junior contributors and contractors usually start in the sandbox column.
  3. Move secrets out of the project tree so a project read does not become a credential read.
  4. Write the exceptions down. If a task needs a broader permission, record who approved it and when it expires.
  5. Review monthly. Permissions drift upward because it is easier to say yes than to take access back.

Common mistakes

Granting a general shell because it is convenient. OWASP advises avoiding open-ended extensions such as a shell or URL fetch in favour of granular ones where you can. If you must allow a shell, pair it with the command allow list above.

Treating the approval prompt as the control. Prompts help, but people click through them. Enforce the limit in the environment so a rushed yes cannot exceed it. See does an approval prompt keep a coding agent in the project for the details.

Try it yourself

Click through it at your own pace, or open it full screen.

Look at how a tool server is connected and what the agent is allowed to call, which is the permission surface this matrix describes.

Safeguard provides an MCP Guardrail and agent identity so you can scope what an agent calls and attribute its actions. Pull request gates cover the merge side.

Quick check

Should agents ever get write access to the default branch?

No. Let the agent open a pull request and let branch protection and a human reviewer decide.

Is a read only agent still risky?

Yes, if it can read secrets and has any outbound path. Read access plus network access can still leak data.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.