Repository navigation
Description
Problem
In Copilot SDK mode, the tools shown to the model can differ from the tools
declared in the workflow.
In the reproduced run:
web_fetchwas enabled but missing from the model's tool list.- Bash was disabled but
bash,read_bash,stop_bash, andlist_bash
were still visible. - Editing was disabled but an editing permission was still generated.
The model tried to use bash because that was the only visible way to fetch a
URL. The SDK blocked the command before it reached AWF, so AWF could neither
allow nor deny the requested destination.
Why this matters
The workflow file should define what an agent can do. Today, SDK mode can show
the model a different capability set.
This makes the workflow hard to reason about and prevents AWF from recording
and enforcing configured network access.
Root cause
Two separate mechanisms were being treated as if they were one:
- The compiler generated permission flags such as
--allow-tool web_fetch. - The SDK independently created the model-visible tool list.
A permission does not register a tool. The SDK session registered no
web_fetch implementation and did not filter its default tools. It therefore
omitted web_fetch and added built-in bash tools.
The compiler also removed explicit false values while applying defaults.
Later code could no longer tell the difference between "not specified" and
"explicitly disabled."
Proposed fix
- Preserve whether a tool was absent, enabled, or explicitly disabled.
- Have the compiler produce one small, versioned SDK tool configuration.
- Use that configuration for both the visible tool list and permission
checks. - Remove the complete bash family when bash is disabled.
- Remove editing tools when editing is disabled.
- Register a bounded
web_fetchtool when it is enabled. - Run
web_fetchinside AWF and always use AWF's proxy, so AWF remains the
place that allows, denies, and records destinations. - Apply the same restrictions to subagents.
- Fail clearly if a future SDK introduces an incompatible tool with the same
name.
Ready implementation
A complete implementation is available for maintainers to inspect or
cherry-pick:
- Branch:
danielmeppiel/gh-aw:danielmeppiel-fix-sdk-tool-catalog - Head:
d54042ad3c715c84299d05ee51598fb8a659e638 - Compare with main
- Commits:
8d932832cd- compiler tool configuration1a1da0a764- SDK filtering andweb_fetchf2f2c1c779- AWF transport and integration testd54042ad3c- review hardening
Proof
Before the fix, the model saw bash but not web_fetch.
After the fix, the captured model tool list was:
view, skill, sql, read_agent, list_agents, write_agent, rg, glob, task,
web_fetch
It did not contain bash, bash session controls, editing tools, or an
unconfigured test MCP tool.
The real AWF test also proved:
- Allowed
example.com: request succeeded and AWF recorded it as allowed. - Unlisted
example.net: request was blocked and AWF recorded the denial. - Explicitly allowed private test address: AWF allowed the connection attempt;
the intentionally unreachable destination returned 503. - No host-side or MCP-based fetch bypass was used.
Compiler, SDK, integration, lint, build, workflow, and lock checks passed.
Independent architecture, security, and test reviews found no remaining
blocker.
Done when
- The visible SDK tool list matches the compiled workflow.
- Explicitly disabled tools stay disabled after defaults are applied.
- Enabled
web_fetchis visible and works inside AWF. - Disabled bash and editing tools are absent, including in subagents.
- AWF records allowed and denied destinations.
- No host-side or MCP fetch bypass exists.
- A pinned real-AWF test runs in CI and uploads its evidence.
Maintainer implementation notes
Compiler output:
{
"version": 1,
"capabilities": {
"bash": false,
"edit": false,
"webFetch": true,
"mcp": false
},
"permissions": {
"allowedTools": ["read", "web_fetch"]
},
"explicitlyDisabledTools": ["bash", "edit", "github"]
}The SDK session builds an explicit allowlist:
if (config.bash) {
allow("bash", "read_bash", "stop_bash", "list_bash");
}
if (config.edit) {
allow("apply_patch", "edit", "create", "delete", "move");
}
if (config.webFetch) {
registerWebFetch();
allow("web_fetch");
}web_fetch accepts only HTTP(S) URLs without embedded credentials, performs
GET requests, limits redirects/time/body size, and sends no model-provided
headers. It does not decide whether private destinations are allowed; AWF owns
that policy.
Main files:
pkg/workflow/copilot_engine_sdk_tools.gopkg/workflow/copilot_engine_execution.gopkg/workflow/copilot_engine_tools.goactions/setup/js/copilot_sdk_tool_config.cjsactions/setup/js/copilot_sdk_session.cjsactions/setup/js/copilot_sdk_web_fetch.cjs
Activity