|
2 | 2 |
|
3 | 3 | Tools to let coding agents access the shell with opinionated defaults. |
4 | 4 |
|
| 5 | +## Security model |
| 6 | + |
| 7 | +Most agent actions should run under [`//sandbox`](sandbox/BUILD.bazel). |
| 8 | +Command filtering complements sandboxing by narrowly delegating selected CLI |
| 9 | +capabilities, including commands that intentionally use the user's ambient |
| 10 | +credentials. It is not a substitute for sandboxing. |
| 11 | + |
| 12 | +Command filtering is useful for narrowing which command lines an agent may run: |
| 13 | +which binaries are allowed, which subcommands and flags are allowed, and which |
| 14 | +logical paths may be passed as arguments. That is a least-authority delegation |
| 15 | +mechanism, not a full security boundary. |
| 16 | + |
| 17 | +If an allowed command can use the user's ambient credentials, network access, |
| 18 | +or other external authority, then allowing that command is effectively |
| 19 | +granting that capability to the agent. Path restrictions such as `<path:r>` |
| 20 | +and `<path:w>` only constrain named file arguments; they do not constrain |
| 21 | +unrelated side effects a command may have. |
| 22 | + |
| 23 | +For example, a user might grant an agent permission to fetch GitHub Actions |
| 24 | +logs via a narrow `gh` rule. That is different from allowing arbitrary `gh` |
| 25 | +usage: the rule is a deliberate delegation of one credential-backed |
| 26 | +capability, not blanket authority over the GitHub CLI. |
| 27 | + |
| 28 | +Some allowed tools may execute hooks, helpers, pagers, editors, or other |
| 29 | +user-controlled programs as part of their normal behavior. |
| 30 | +Rules should be written with those secondary execution paths in mind. |
| 31 | + |
| 32 | +Practical guidance: |
| 33 | + |
| 34 | +- Prefer running agent actions in `//sandbox`. |
| 35 | +- Use command filters to grant narrow, reviewable capabilities, especially for |
| 36 | + tools that intentionally act with the user's ambient credentials. |
| 37 | +- Write rules per operation, not per binary. |
| 38 | +- Treat each allow-rule as a permission grant that should be reviewed. |
| 39 | + |
5 | 40 | ## License |
6 | 41 |
|
7 | 42 | Apache-2.0 |
|
0 commit comments