Skip to content

Support AWF proxy endpoints via AWF_COPILOT_PROXY#229

Merged
anticomputer merged 2 commits intomainfrom
anticomputer/awf-proxy-support
Apr 23, 2026
Merged

Support AWF proxy endpoints via AWF_COPILOT_PROXY#229
anticomputer merged 2 commits intomainfrom
anticomputer/awf-proxy-support

Conversation

@anticomputer
Copy link
Copy Markdown
Contributor

When running inside an AWF (Agentic Workflow Firewall) sandbox, the API endpoint is a local proxy URL (e.g., http://172.30.0.30:10002) that the provider registry doesn't recognize.

This adds support for the AWF_COPILOT_PROXY env var, which names the upstream provider (e.g., api.githubcopilot.com) whose behaviour (headers, model defaults, catalog parsing) should be used with the proxy URL as base_url.

The audit pipeline sets:

  • AI_API_ENDPOINT=http://172.30.0.30:10002 (AWF sidecar)
  • AWF_COPILOT_PROXY=api.githubcopilot.com (upstream provider)
  • AI_API_TOKEN=placeholder (sidecar strips and injects real token)

This lets the taskflow agent work seamlessly through AWF's credential-isolating API proxy sidecar without any hardcoded proxy addresses.

When running inside an AWF sandbox, the API endpoint is a local
proxy URL (e.g., http://172.30.0.30:10002) that the provider
registry doesn't recognize. The AWF_COPILOT_PROXY env var names
the upstream provider (e.g., 'api.githubcopilot.com') whose
behaviour (headers, model defaults, catalog parsing) should be
used with the proxy URL as base_url.

This lets the taskflow agent work seamlessly through AWF's
credential-isolating API proxy sidecar.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a mechanism for resolving provider-specific behavior (headers, catalog parsing, defaults) when AI_API_ENDPOINT points at an AWF (Agentic Workflow Firewall) local proxy whose netloc is not present in the provider registry.

Changes:

  • Extend get_provider() to recognize AWF_COPILOT_PROXY and derive provider behavior from the named upstream provider while using the proxy URL as base_url.
  • Expand get_provider() docstring to document the AWF proxy behavior.
Show a summary per file
File Description
src/seclab_taskflow_agent/capi.py Adds AWF proxy endpoint support by mapping proxy endpoints to an upstream provider’s behavior via AWF_COPILOT_PROXY.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 3

Comment thread src/seclab_taskflow_agent/capi.py Outdated
Comment thread src/seclab_taskflow_agent/capi.py
Comment thread src/seclab_taskflow_agent/capi.py Outdated
- Use dataclasses.replace() instead of manual field reconstruction
  to avoid silently dropping fields if APIProvider gains new ones
- Normalize AWF_COPILOT_PROXY input: accept both bare hostnames
  (api.githubcopilot.com) and full URLs (https://api.githubcopilot.com)
- Add 4 test cases covering bare hostname, full URL, unknown upstream,
  and unset env var scenarios
@anticomputer anticomputer merged commit b71c2e0 into main Apr 23, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants