[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/agentgateway/agentgateway/network/alerts). </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Basic Example
This example shows how to use the agentgateway to proxy A2A requests.
Running the example
cargo run -- -f examples/a2a/config.yaml
Let's look at the config to understand what's going on. Like in the basic setup, we define a bind and listener.
This time, our backend will not be of type mcp and will just be a plain host.
The a2a policy indicates this traffic is A2A and will be processed accordingly
policies:
# Mark this route as a2a traffic
a2a: {}
backends:
- host: localhost:9999
To test this, we will run a sample a2a agent and client.
First, run the server:
$ git clone https://github.com/a2aproject/a2a-samples
$ cd a2a-samples/samples/python
$ uv run agents/helloworld
In another terminal, run the client and send a few messages.
$ uv run hosts/cli --agent http://localhost:3000
Agentgateway will proxy the requests and do a few things.
First, we can directly send a request to agentgateway to the agent card endpoint.
The agent will typically do this automatically, but we will use curl to manually look at the card.
$ curl http://localhost:3000/.well-known/agent.json | jq
{
"description": "Just a hello world agent",
"url": "http://localhost:3000",
}
You can see the url has been rewritten to point back to agentgateway, ensuring future requests do not bypass the gateway.
Additionally, as we send requests we can see A2A specific information in the logs:
2025-07-03T16:56:34.379262Z info request gateway=bind/3000 listener=listener0
route=route0 endpoint=localhost:9999 src.addr=127.0.0.1:57408
http.method=POST http.host=localhost http.path=/ http.version=HTTP/1.1 http.status=200
a2a.method=message/stream duration=2ms