October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

Which Permissions Should You Give an AI Agent? A Least-Privilege Guide

Give an AI agent only the access required for its task. Set workspace, network, credential, approval, and recovery controls using the settings for the product you run.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Give an AI agent only the files, tools, network destinations, and credentials needed for its current task. Start in a dedicated workspace, keep network access off unless the work requires it, keep secrets out of the agent’s execution environment, and require review for consequential actions. The exact controls differ by product, so check the documentation for the specific agent and where it runs.

Why an agent’s permissions matter

An AI agent can use the capabilities available to its runtime. That can include reading or changing files, running commands, reaching network destinations, and using credentials present in its environment. OpenAI’s sandbox security guidance puts the practical point plainly: “Agent-generated code can access the files, credentials, and network available to its environment.”

As an Amazon Associate I earn from qualifying purchases.

Least privilege means granting only the minimum access needed for the task, rather than enabling broad access for convenience. It does not mean relying on a prompt that asks the agent to behave carefully: permissions should enforce the boundary where the product supports it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose permissions by task

Permission area Starting point Expand access when
Files Limit access to a dedicated project workspace; grant write access only for files the task may change. The task demonstrably needs other files. Add only the necessary paths and review the product’s path restrictions.
Commands and tools Enable only the tools needed to complete the task, and run code in an isolated environment when possible. A required build, test, or other operation needs a particular capability. Consider its inherited privileges and side effects.
Network Disable outbound access when the task can be done offline. The task needs specific external services or hosts. Prefer an explicit allowlist over broad outbound access.
Credentials Keep application keys and third-party secrets outside the execution environment. A task needs authenticated access. Prefer scoped, brokered access to the required service rather than exposing a reusable secret to generated code.
Approvals Require human review for boundary-crossing or higher-impact actions. Adjust review rules only after confirming what the product can enforce and what the action can affect.
Recovery and audit Keep a recoverable baseline, such as a version-control checkpoint, and retain useful activity records. Choose a workflow appropriate to the value and sensitivity of the work.

Set up a least-privilege workspace

1. Define the task boundary

Write down what the agent must do, which project files it needs, which tools it must use, and whether it needs external hosts. This makes it easier to spot access that is merely convenient rather than necessary.

2. Isolate the work

Use a dedicated project directory or isolated compute environment. Avoid mounting unrelated folders, shared user data, or sensitive locations by default. OpenAI recommends isolated compute for agent workloads and separate environments when users or workloads must not share data; the appropriate design depends on the workload.

3. Limit file writes

Give write access only to the paths the task needs to change. Keep secrets and unrelated files outside the workspace, and verify whether the agent’s product technically blocks access outside its stated workspace or merely treats it as a convention.

4. Decide whether networking is necessary

If the task works offline, leave outbound networking disabled. If it needs network access, identify the required destinations and allow only those where the product supports that control. Anthropic’s Cloud environment setup documentation describes its managed environment’s networking field: limited restricts access to allowed hosts, while unrestricted permits broad outbound access subject to a safety blocklist. In that product, limited networking with no additional host entries allows no hosts. These labels and behaviors are Anthropic-specific, not universal settings.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

That documentation also notes that package-manager and MCP access may require separate switches. Do not assume that a network setting controls every route to external services; check the relevant product controls and audit the allowed destinations.

5. Keep credentials outside generated code where possible

A secret placed in an agent’s execution environment can be read by code running there. Keep application API keys and third-party credentials in a trusted harness or secrets system when possible. A trusted proxy or broker can expose a narrow, approved operation without handing the agent a reusable credential. If exposure is suspected, revoke or rotate the affected credential.

6. Add review and recovery controls

Approvals and sandboxing address different risks: a sandbox limits what execution can reach, while an approval policy determines which proposed actions need human review. Keep review for actions that cross the intended boundary or have higher impact. Before and after work, preserve a recoverable baseline and inspect the resulting changes.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Sandboxing, approvals, and audit logs are different controls

OpenAI’s Agents SDK sandbox guide describes the sandbox as an execution plane for files, commands, packages, mounts, ports, and state. It recommends keeping trusted control functions—such as authentication, billing, audit logs, human review, and recovery state—in the harness rather than inside the sandbox. This is an architectural approach for workloads that need a workspace, not a requirement for every simple assistant interaction.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

OpenAI’s Codex security documentation likewise distinguishes the technical execution boundary from approval policy. Audit records can help explain tool activity, approval decisions, results, and network policy decisions; what is recorded depends on the product and deployment. Use logs to investigate what happened, not as a substitute for limiting access in the first place.

Product controls are not interchangeable

Codex and Codex CLI

OpenAI’s Codex materials describe a permissions interface; Codex CLI documentation identifies /permissions as a way to choose what the agent may do. The CLI guidance also recommends Git checkpoints around a task. Verify the current controls for the particular Codex surface you use—app, CLI, IDE, or cloud—rather than assuming that one permission name or default applies everywhere.

Anthropic managed environments

Anthropic’s managed environment documentation describes outbound networking choices and allowed-host controls for that environment. It says to set networking explicitly in API requests; its Console creation form starts with Limited selected and no hosts allowed. These are product-specific, version-sensitive details, not defaults to assume for another agent or deployment.

Before granting broader access

  • Can the task be completed with a smaller workspace or fewer tools?
  • Is outbound network access required, and can it be restricted to named destinations?
  • Could generated code read credentials or unrelated files in the environment?
  • Which actions need human review, and can you inspect their proposed changes first?
  • Can you recover the project if the agent makes an unwanted change?
  • Do the product’s documentation and audit controls match the boundary you intend to enforce?

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.