Argy Code permissions and security
Allow/ask/deny permission model, bash policy, DependencyGuard, .env files, encrypted credentials, local server and hermetic machine mode in Argy Code.
Argy Code performs real actions on your machine: reading and writing files, running shell commands, accessing the network. This page describes the mechanisms that frame those actions, what they cover, and where they stop. It is written for developers who tune authorizations and for security teams assessing the tool. For the platform-level security model, see Security model.
Permission model
Each tool is evaluated against one of three actions:
| Action | Effect |
|---|---|
allow | The tool runs without confirmation. |
ask | In the terminal interface, Argy Code asks for confirmation before running. In unattended execution (argy run), the request is approved automatically and traced: see Unattended execution. |
deny | The tool is refused, in the interface and in unattended execution alike. |
Rules are declared under the permission key of argy.json, globally or per agent. Three formats are accepted: a single action for all tools, an object per tool with glob patterns, or ask, allow, deny lists.
{
"permission": {
"edit": { "*": "ask", "src/**": "allow" },
"bash": {
"git *": "allow",
"git push *": "ask",
"rm -rf *": "deny",
},
"webfetch": "ask",
},
}
The last matching rule wins: put general rules ("*", "git *") first and specific cases after. In the example, git status is allowed, but git push origin main asks for confirmation because the git push * rule comes after git *. In bash command patterns, * matches any sequence of characters, and a trailing * after a space also matches the bare command: git push * covers both git push and git push origin main. A pattern without a wildcard, such as git push, only matches that exact command.
Tools covered
The recognized permission keys are read, edit, glob, grep, list, bash, subagent (legacy alias task), external_directory, todowrite, todoread, question, webfetch, websearch, lsp, skill and doom_loop. Other tools can be added as extra keys.
Defaults
| Item | Default behavior |
|---|---|
| Tools in general | allow |
doom_loop | ask: detection of looping tool calls. |
external_directory | ask: access to files outside the project. |
Reading *.env and *.env.* files | ask; *.env.example is allowed. |
| Creating and publishing module bundles through the Studio tools | ask |
These defaults can be changed in configuration. The ARGY_PERMISSION variable also lets you inject permissions from the environment.
Safety floors for restricted agents
Some native agents are deliberately restricted: the planner does not modify code, the reviewer is read-only. Their safety floors are applied after user configuration, so a global "bash": "allow" does not reopen the planner's write access. See Agents and modes for the list of agents and their rights.
Unattended execution
A confirmation prompt assumes a person answers it. That is only the case in the terminal interface. With argy run and argy run --machine, nobody is there to answer, so requests are decided automatically:
| Situation | Result with argy run |
|---|---|
deny rule from the agent or the configuration | Final refusal. |
deny rule from an enterprise policy | Final refusal. |
Path outside the run workspace (external_directory permission) | Final refusal, whatever the rules; only the run workspace and, in machine mode, its private temporary directory are accessible. |
ask rule (default or explicit), enterprise ask rule | Approved automatically, with an audit trace in the session. |
| Confirmation forced by a safeguard (for example the bash policy's anti-exfiltration) | Approved automatically and traced; the "cannot be remembered" confirmation only applies in the interface. |
| Question asked to the user | Answered automatically; nothing waits for a person. |
With argy run --attach <url>, permission requests that reach the client are rejected automatically.
Practical consequences:
- An
askis not a human review in CI. To forbid an action, usedeny, or a read-only agent such as the reviewer or the planner (Agents and modes). - For an action that requires a human decision (publishing a module, changing sensitive files, reading a
.env), plan a separate approval step before launch: manual approval of the job in your CI, or a review of the changes before re-running. - Automatic decisions remain inspectable: each approval is traced in the session and emitted as an event with
--format json(Automation).
Per-executable execution policy
The exec_policy.rules key adds targeted rules on the commands the agent runs.
| Field | Type | Required | Description |
|---|---|---|---|
executable | string | Yes | Executable name or glob pattern. |
args_pattern | string | No | Glob pattern on the arguments. |
action | allow, deny, require_approval | Yes | Decision applied. |
reason | string | No | Message shown when the rule applies. |
{
"exec_policy": {
"rules": [
{
"executable": "kubectl",
"args_pattern": "delete *",
"action": "require_approval",
"reason": "Resource deletion: human approval required",
},
],
},
}
Bash policy
Beyond permissions, the bash tool applies its own policy.
- Fixed blocks: some categories of commands are permanently rejected, with no setting to allow them: destroying the file system or a disk, deliberately exhausting the machine's resources, opening permissions across the whole system, and directly running unreviewed remote code.
- Supply chain: commands that change dependencies go through DependencyGuard (see below).
- Anti-exfiltration: if untrusted content was observed in the session (web page, third-party file) and a command looks like sending a secret outside, explicit confirmation is required in the terminal interface and cannot be remembered. In unattended execution, this confirmation is approved automatically and traced (see Unattended execution).
For anything that is not permanently blocked, the permission system described above (bash set to allow, ask or deny, with patterns) and exec_policy decide. For agents and parallel work, see Agents and modes.
DependencyGuard
DependencyGuard protects the software supply chain. Any command that changes the dependency graph is blocked until an audited decision exists. It covers common package managers (npm, pnpm, yarn, bun, pip, uv, poetry, cargo, go, dotnet, maven, composer, bundler, and others), as well as direct edits of a manifest or lockfile.
The flow is:
- The agent calls the
dependency_intaketool to assess the package: public security advisories and typosquatting heuristics. - If the assessment is safe, it records a decision in
.argy/dependency-intake.json. - It then runs exactly the recorded command.
A decision is valid for 60 minutes and for one exact command. Never edit that file by hand: a manually written decision is not recognized. Reinstalls that respect an existing lockfile (npm ci, for example) are not blocked.
.env files and directories outside the project
Reading a *.env or *.env.* file goes through a confirmation (ask) by default in the terminal interface, and so does access to a directory outside the project (external_directory). Keep these defaults; if you relax them, restrict yourself to precise patterns. In argy run, reading a .env is approved automatically and traced, whereas a directory outside the run workspace is refused. To forbid reading a .env in unattended execution, set a deny rule (Unattended execution).
Credentials and authentication
argy auth login uses the device-code flow by default; the --pat option uses a personal access token. Credentials are stored encrypted, with the key kept in the operating system's native secret store when available. Files are written with permissions restricted to the user.
For non-interactive use, provide the token through the ARGY_PAT environment variable, never in clear text in a versioned file. See Authentication and IAM for token management on the platform side.
Local server
The argy serve and argy acp commands and the terminal interface start a local server. By default it listens on 127.0.0.1 only. If you expose it (--hostname option, --mdns discovery, --cors domains), enable basic authentication with ARGY_SERVER_USERNAME and ARGY_SERVER_PASSWORD. Note that --mdns defaults the hostname to 0.0.0.0.
Hermetic machine mode
argy run --machine is an isolated runtime designed for workflow-driven executions (see Automation). In this mode:
- plugins, MCP servers, language servers, formatters, sharing and automatic update are disabled;
- custom tools from the repository are ignored;
- paths are confined to the run workspace and its private temporary directory (final refusal outside those areas);
- the presence of
ARGY_PATis rejected: inference must go through run-specific authority.
Sandbox: what it covers and what it does not
Argy Code ships an operating-system-level sandbox mechanism, but today it only applies to JavaScript REPL execution. It does not confine the shell commands of the bash tool. For the shell, protection relies on permissions, bash policy, DependencyGuard and human approval. Argy Code is therefore not a sandboxed runtime for untrusted commands. Strong isolation comes from running it inside a container or a virtual machine.
A network proxy can be applied to subprocesses with ARGY_NETWORK_PROXY.
Undo and recovery
File changes are tracked: /undo and /redo restore the previous state (see Slash commands and interface). Sessions are stored in local storage; the storage.backup key tunes backups.
Common errors
| Symptom | Likely cause | Fix |
|---|---|---|
An npm install or pip install command is blocked | DependencyGuard: no decision recorded | Let the agent go through dependency_intake, one package at a time. |
curl ... | sh is refused | Blocked in every mode | Download the script, review it, then run it. |
A permission rule has no effect on a restricted agent | Safety floor applied after configuration | Use a suitable agent, or create a custom one (Extensions). |
Reading a .env prompts for confirmation | Default behavior in the terminal interface | Confirm case by case, or add a targeted rule. In argy run, use deny to forbid it. |
An ask did not block an action during argy run | ask is approved automatically without interaction | Replace it with deny, or add a separate approval before launch. |