Skip to content
Technology, explained from the insideAI · Software · Digital payments
TayoTechTalk.

AI Software Development

AI Coding Agents: Set Boundaries Before They Run Commands

By Temitayo Solomon Gbadebo · November 24, 2026
A coding workspace inside a transparent boundary, with credentials, a database and cloud access separated behind an approval gate.

An AI coding agent can read a project, edit files and run commands while working towards a goal. That makes it useful for tasks such as fixing a bug or adding a small feature. It also means a mistaken instruction can affect more than the answer shown in a chat window.

Before starting, decide what the agent can actually reach. Which files can it read? Which directories can it change? Can it contact external services, use credentials or trigger a deployment? These are separate questions, and the answers should match the job.

Our guides to testing AI-generated code and reviewing suggested dependencies focus on the work produced. This guide focuses on the environment in which that work happens.

Start with one task and the access it needs

Imagine a team asking an agent to add a CSV export button to an internal reporting application. The example is hypothetical. The intended result is a code change and test results for human review, not a release to users.

A reasonable starting scope might be:

  • Read: the reporting module, shared UI components, project documentation and synthetic test fixtures.
  • Change: the relevant source files and tests in a disposable working copy.
  • Run: the reviewed local build and test commands with temporary output directories.
  • Keep separate: production records, deployment credentials, unrelated repositories and the developer’s personal files.
  • Require a separate decision: adding a dependency, expanding network access, changing CI permissions or deploying.

This is a planning example, not a configuration file. Translate it into the controls supported by the actual tool and operating system. If the setup cannot enforce a boundary, record that limitation rather than assuming the written instruction makes it real.

OWASP’s AI Agent Security guidance recommends minimum necessary tools, per-tool permission scopes and authorization for sensitive operations. For the CSV task, that means asking why a capability is needed before adding it.

Separate instructions, approvals and technical restrictions

Three different controls can support that scope:

  • An instruction tells the agent what you want it to do, such as “prepare the change without deploying it.”
  • An approval gate pauses a proposed action for a decision, such as allowing access to a new service.
  • A sandbox restricts what a process can access while it runs, even if the process tries something outside the permitted scope.

OpenAI’s account of running Codex safely describes sandbox boundaries and approvals as distinct controls. The practical lesson is to check both: what will trigger a prompt, and what is technically prevented?

A setting that restricts writes to a project folder may still allow broader reading. A “read-only” connection may still expose confidential information. Check read access independently from write access, including environment variables and mounted folders.

Nor does the word “container” settle the question. Docker’s security documentation explains why host-directory mounts and access to the Docker daemon matter. A container with powerful host access can undermine the separation you intended. Use a reviewed configuration instead of treating the container label as a guarantee.

Treat repository text as input that can be misleading

An agent may encounter instructions inside a README, issue description, code comment, tool response or web page. Some are legitimate project guidance. Others may be accidental, outdated or deliberately malicious.

Prompt injection is an attempt to redirect an AI system through material it processes. Anthropic’s Claude Code security guidance explains this risk and recommends reviewing commands and changes to critical files.

In the CSV example, imagine an issue comment saying that the export will fail unless the developer uploads the project’s environment file to a diagnostic website. The comment does not establish that the website is trusted or that sharing the file is necessary. It should not expand the task’s permissions.

Check where an instruction came from, whether it matches the actual request and what effect following it would have. Keep sensitive configuration out of the agent’s accessible workspace where possible. A clear prompt helps, but access controls should limit the consequences if the agent misinterprets what it reads.

Review what a command executes, not just its name

“Run the tests” sounds routine. A test command can launch project code, setup hooks, browser automation or other subprocesses. Its effects depend on the repository and environment.

Suppose the CSV project uses npm test. Before allowing repeated execution, inspect the script it invokes and the relevant setup. Does it use a temporary database? Could it contact a shared service? Has the agent changed the script since the last review?

Apply the same care to build and installation commands. A familiar command name does not prove that every project-specific action underneath it is harmless. Review changed scripts and configuration files alongside application code.

For this task, run against invented records in an isolated test environment. Give the process only the access needed for those tests. If a test unexpectedly requires a production connection, stop and examine that dependency rather than supplying production credentials to make the check pass.

Check network access across every tool

Network access supports useful work: fetching documentation, downloading dependencies and querying an approved development service. It also creates ways for source code or credentials to leave the environment.

Define which destinations are needed and why. An allowlist is a list of permitted destinations, but permission to reach a host does not mean every upload or action on that host is appropriate.

GitHub’s Copilot firewall documentation describes an important scope limit: the firewall applies to processes started through the agent’s Bash tool, but not directly to MCP server processes or configured setup steps. It also warns that the firewall is not a complete security solution.

MCP, the Model Context Protocol, connects an assistant to additional tools and services. Review those connections separately. A restriction on shell commands does not automatically restrict a browser, a remote database connector or a cloud-management tool.

Likewise, Claude Code’s sandbox documentation distinguishes sandboxed shell commands from tools and processes outside that boundary. Product details change, so inspect the documentation and active configuration for the version and surface you use.

Keep credentials narrow and production access separate

The CSV feature should be testable without real customer records or a deployment token. Start with synthetic data and no unnecessary credentials. If an integration test genuinely needs access, use a dedicated test account with the smallest practical scope and lifetime.

Check more than files named .env. A process may inherit secrets through environment variables, credential helpers or an already authenticated tool. The relevant question is what authority the process can exercise.

In CI, GitHub’s secure-use guidance recommends minimum token permissions and warns that automatic secret redaction is not guaranteed. Logs are evidence of what happened, but they can also become another place where sensitive information is exposed.

For our example, keep deployment in a separate reviewed workflow. The agent’s ability to prepare a patch should not automatically include permission to merge it, publish it or change the credentials that protect it.

Verify the boundaries using harmless checks

Do not test isolation with a real secret or a destructive command. Use disposable fixtures and controls owned by the team:

  1. Allowed work: confirm the agent can edit a sample file in the approved workspace and run the intended local test.
  2. Protected files: use a dummy file in a deliberately restricted test directory to check that access is denied as expected.
  3. Network limits: check an approved harmless destination and a team-controlled blocked destination without sending private data.
  4. Other tools: inspect the permissions of enabled connectors, browsers and helper services separately from the shell.
  5. Expanded requests: confirm that a request for extra access pauses or fails according to policy instead of silently receiving broader permissions.

These checks provide evidence about the tested setup, not proof against every possible attack. Record the tool version, active policy and observed result. Repeat relevant checks when the environment or permissions change.

Review the result and close the session deliberately

For the CSV task, the final handover should include the changed files, the commands actually run, the tests that passed or failed and any additional access used. Read the diff, especially changes to dependencies, scripts, CI configuration and security settings.

Where approval is needed, review the concrete action and destination. “Continue setup” is less useful than an explanation of the exact service, requested permission and reason. A materially different action needs a fresh decision; an earlier approval should not become a general pass.

Finish by removing temporary access that is no longer needed and keeping the review record. If a credential was exposed, follow the team’s incident process, including revocation or rotation where appropriate.

A productive coding-agent setup lets routine work proceed inside a small, understood environment. Define that environment first, verify the boundaries, and expand access only when the task provides a clear reason.

Sources and product documentation checked on 9 November 2026. The CSV scenario and permission checklist are illustrative, not a claim about a deployed system or a tested configuration.