agent-workbench-fastapi
Thin streaming adapter for mounting a standalone Agent Workbench service in a FastAPI application without giving the Python process a Node or Postgres dependency.
pip install agent-workbench-fastapi
from contextlib import asynccontextmanager
from fastapi import FastAPI
from agent_workbench_fastapi import AgentWorkbenchProxy
workbench = AgentWorkbenchProxy("http://agent-workbench:8080/api/agent")
@asynccontextmanager
async def lifespan(_app: FastAPI):
await workbench.verify_upstream()
yield
app = FastAPI(lifespan=lifespan)
app.mount("/api/agent", workbench)
The proxy forwards only standard content negotiation, content, authentication,
cookie, tracing, and idempotency headers by default. It does not forward
client-supplied identity or tenant headers. The upstream Workbench service must
verify the user credential, or the host must provide a resolve_headers
callback that creates a trusted service-to-service identity assertion.
Request and response bodies are streamed. Long-running agent responses are not buffered by the adapter.
The adapter validates and caches the upstream service manifest before the first
forwarded request. It returns agent_protocol_incompatible when the service is
not Agent Workbench protocol v1, and agent_service_unavailable when it cannot
be reached. Calling verify_upstream() during FastAPI lifespan makes a bad
sidecar fail application startup instead of waiting for live traffic.
The adapter and TypeScript runtime have independent versions. Python releases
use tags in the form agent-workbench-fastapi-vX.Y.Z and are published to
PyPI. The Agent Workbench service itself can run beside the FastAPI application
or elsewhere on the company's private network.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_workbench_fastapi-0.2.0.tar.gz.
File metadata
- Download URL: agent_workbench_fastapi-0.2.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
374dc3c46cbb247ccbc3b64c737c7c90b0ab2f7e9cb1c378cf736fd13d9c48c5
|
|
| MD5 |
43d9b2ab6c8d39629c9d53d311c6b989
|
|
| BLAKE2b-256 |
75f292c5083eee92decb1e7f1eaf6abd4c91c15ab7a57bfde6e8cb06929e98ec
|
Provenance
The following attestation bundles were made for agent_workbench_fastapi-0.2.0.tar.gz:
Publisher:
python-release.yml on Dark-Horse-Labs/agent-workbench
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_workbench_fastapi-0.2.0.tar.gz -
Subject digest:
374dc3c46cbb247ccbc3b64c737c7c90b0ab2f7e9cb1c378cf736fd13d9c48c5 - Sigstore transparency entry: 2714322765
- Sigstore integration time:
-
Permalink:
Dark-Horse-Labs/agent-workbench@8f9f180e2b44b1f6245d2597c0c375dabb1d72f2 -
Branch / Tag:
refs/tags/agent-workbench-fastapi-v0.2.0 - Owner: https://github.com/Dark-Horse-Labs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-release.yml@8f9f180e2b44b1f6245d2597c0c375dabb1d72f2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file agent_workbench_fastapi-0.2.0-py3-none-any.whl.
File metadata
- Download URL: agent_workbench_fastapi-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b52e9e73346497f214afdb8774bb06e3033a01009418cbf96f48b3cbb92c9c71
|
|
| MD5 |
65232331b637c1f09810ccfa20108d5f
|
|
| BLAKE2b-256 |
d76e4f506e58bc15e2b18d8f0dc6b341477f0cf301e4ed1a813eea186858a6b0
|
Provenance
The following attestation bundles were made for agent_workbench_fastapi-0.2.0-py3-none-any.whl:
Publisher:
python-release.yml on Dark-Horse-Labs/agent-workbench
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_workbench_fastapi-0.2.0-py3-none-any.whl -
Subject digest:
b52e9e73346497f214afdb8774bb06e3033a01009418cbf96f48b3cbb92c9c71 - Sigstore transparency entry: 2714322811
- Sigstore integration time:
-
Permalink:
Dark-Horse-Labs/agent-workbench@8f9f180e2b44b1f6245d2597c0c375dabb1d72f2 -
Branch / Tag:
refs/tags/agent-workbench-fastapi-v0.2.0 - Owner: https://github.com/Dark-Horse-Labs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-release.yml@8f9f180e2b44b1f6245d2597c0c375dabb1d72f2 -
Trigger Event:
push
-
Statement type: