Skip to content

Make Copilot SDK tool catalogs match compiled workflow tools #56949

Closed

Description

@danielmeppiel

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_fetch was enabled but missing from the model's tool list.
  • Bash was disabled but bash, read_bash, stop_bash, and list_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:

  1. The compiler generated permission flags such as
    --allow-tool web_fetch.
  2. 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

  1. Preserve whether a tool was absent, enabled, or explicitly disabled.
  2. Have the compiler produce one small, versioned SDK tool configuration.
  3. Use that configuration for both the visible tool list and permission
    checks.
  4. Remove the complete bash family when bash is disabled.
  5. Remove editing tools when editing is disabled.
  6. Register a bounded web_fetch tool when it is enabled.
  7. Run web_fetch inside AWF and always use AWF's proxy, so AWF remains the
    place that allows, denies, and records destinations.
  8. Apply the same restrictions to subagents.
  9. 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 configuration
    • 1a1da0a764 - SDK filtering and web_fetch
    • f2f2c1c779 - AWF transport and integration test
    • d54042ad3c - 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_fetch is 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.go
  • pkg/workflow/copilot_engine_execution.go
  • pkg/workflow/copilot_engine_tools.go
  • actions/setup/js/copilot_sdk_tool_config.cjs
  • actions/setup/js/copilot_sdk_session.cjs
  • actions/setup/js/copilot_sdk_web_fetch.cjs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugcommunitycopilotmcpworkflows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions