Commit 893fa02
authored
Guard coverage: classify
`gh agent-task create` (`POST
copilot-api/agents/swe/v1/jobs/{owner}/{repo}`) had no guard entry
despite causing real repo mutations (branch creation + PR). Per agent
instructions, this operation is read-write (reads task context, writes
branch/PR) and unsupported (unconditionally blocked).
### `tools.rs`
- Added `"create_agent_task"` to `READ_WRITE_OPERATIONS` — operation is
classified as `"read-write"` in `label_resource`
- Added `"create_agent_task"` to `is_blocked_tool()` — DIFC evaluator
always denies it via `blocked_integrity` override, consistent with
`transfer_repository`, `archive_repository`, etc.
### `labels/tool_rules.rs`
- Added match arm for `create_agent_task` applying repo-visibility
secrecy before the `blocked_integrity` override kicks in at
`label_resource`
```rust
// tools.rs
pub const READ_WRITE_OPERATIONS: &[&str] = &[
// ...existing entries...
"create_agent_task", // gh agent-task create — blocked: unsupported agent operation
];
pub fn is_blocked_tool(tool_name: &str) -> bool {
matches!(
tool_name,
"transfer_repository" | "archive_repository" | "unarchive_repository"
| "rename_repository" | "create_agent_task"
)
}
```
> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses (expand for details)</summary>
>
> #### I tried to connect to the following addresses, but was blocked by
firewall rules:
>
> - `example.com`
> - Triggering command: `/tmp/go-build2534278610/b340/launcher.test
/tmp/go-build2534278610/b340/launcher.test
-test.testlogfile=/tmp/go-build2534278610/b340/testlog.txt
-test.paniconexit0 -test.timeout=10m0s
/tmp/go-build2534278610/b223/vet.cfg flib/difflib.go 64/src/runtime/cgo
x_amd64/compile` (dns block)
> - `invalid-host-that-does-not-exist-12345.com`
> - Triggering command: `/tmp/go-build2534278610/b322/config.test
/tmp/go-build2534278610/b322/config.test
-test.testlogfile=/tmp/go-build2534278610/b322/testlog.txt
-test.paniconexit0 -test.timeout=10m0s rev-��
ternal/engine/wazevo/backend/isa/amd64/abi_entry_amd64.s` (dns block)
> - `nonexistent.local`
> - Triggering command: `/tmp/go-build2534278610/b340/launcher.test
/tmp/go-build2534278610/b340/launcher.test
-test.testlogfile=/tmp/go-build2534278610/b340/testlog.txt
-test.paniconexit0 -test.timeout=10m0s
/tmp/go-build2534278610/b223/vet.cfg flib/difflib.go 64/src/runtime/cgo
x_amd64/compile` (dns block)
> - `slow.example.com`
> - Triggering command: `/tmp/go-build2534278610/b340/launcher.test
/tmp/go-build2534278610/b340/launcher.test
-test.testlogfile=/tmp/go-build2534278610/b340/testlog.txt
-test.paniconexit0 -test.timeout=10m0s
/tmp/go-build2534278610/b223/vet.cfg flib/difflib.go 64/src/runtime/cgo
x_amd64/compile` (dns block)
> - `this-host-does-not-exist-12345.com`
> - Triggering command: `/tmp/go-build2534278610/b349/mcp.test
/tmp/go-build2534278610/b349/mcp.test
-test.testlogfile=/tmp/go-build2534278610/b349/testlog.txt
-test.paniconexit0 -test.timeout=10m0s go_.�� @v1.1.3/ascii/eq-errorsas
@v1.1.3/ascii/va-ifaceassert x_amd64/vet -I
/tmp/go-build132/usr/bin/runc -I x_amd64/vet -I g_.a 0098554/b151/
x_amd64/vet -o /dev/null` (dns block)
>
> If you need me to access, download, or install something from one of
these locations, you can either:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this
repository's [Copilot coding agent
settings](https://github.com/github/gh-aw-mcpg/settings/copilot/coding_agent)
(admins only)
>
> </details>create_agent_task as read-write and blocked (#3139)2 files changed
Lines changed: 35 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
627 | 627 | | |
628 | 628 | | |
629 | 629 | | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
630 | 639 | | |
631 | 640 | | |
632 | 641 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
| |||
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
| 127 | + | |
| 128 | + | |
124 | 129 | | |
125 | 130 | | |
126 | 131 | | |
127 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
128 | 137 | | |
129 | 138 | | |
130 | 139 | | |
| |||
210 | 219 | | |
211 | 220 | | |
212 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
213 | 238 | | |
0 commit comments