Skip to main content

Proxy URL Integration

The proxy URL integration requires zero code changes to your agent. You only change the base URL your HTTP client uses.

How it works

Your proxy URL encodes your agent's API key:

https://api.agentic-guard.com/proxy/{api_key}/{target_url}

To call https://api.github.com/repos/openai/openai-python, prefix it with your proxy base:

https://api.agentic-guard.com/proxy/ag_xxx/api.github.com/repos/openai/openai-python

Getting your proxy URL

  1. Go to Agents in the dashboard
  2. Click an agent row to expand it
  3. Your proxy URL is shown in the Integration panel

Or call the API:

curl -H "Authorization: Bearer $JWT" \
https://api.agentic-guard.com/agents/{agent_id}/proxy-url

Response:

{
"proxy_url": "https://api.agentic-guard.com/proxy/ag_xxx/",
"api_key_prefix": "ag_xxx...",
"usage_example": "httpx.get('{proxy_url}api.github.com/...')"
}

Python / httpx

import httpx

PROXY_BASE = "https://api.agentic-guard.com/proxy/ag_xxx/"

# GET request
resp = httpx.get(f"{PROXY_BASE}api.github.com/repos/openai/openai-python")

# POST request
resp = httpx.post(
f"{PROXY_BASE}api.stripe.com/v1/charges",
json={"amount": 1000, "currency": "usd"},
headers={
"X-Agent-Reasoning": "User requested payment for order #123",
"X-Agent-Task-Id": "task_abc",
},
)

Python / requests

import requests

PROXY_BASE = "https://api.agentic-guard.com/proxy/ag_xxx/"

resp = requests.get(f"{PROXY_BASE}api.github.com/user")

Optional headers

Pass these headers to enrich your audit log:

HeaderDescription
X-Agent-ReasoningWhy the agent is making this call
X-Agent-Task-IdThe task or workflow this call belongs to

These headers are stripped before forwarding to the upstream API.

Supported HTTP methods

GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS

Query parameters

Query parameters are forwarded as-is:

resp = httpx.get(f"{PROXY_BASE}api.github.com/search/repositories", params={"q": "docusaurus"})
# Forwards: GET https://api.github.com/search/repositories?q=docusaurus

Request body

Request bodies (JSON, form data, binary) are forwarded unchanged.

Credential injection

If you have a credential stored for the target hostname, it is injected automatically. Your code does not need to include the Authorization header.

See Credentials → for how to add credentials.