Observed since 20 Oct, 21:44 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Middleware proxy for AI agent request attribution and compliance audit trails
A FastAPI-based middleware proxy that automatically attributes every AI request to agents, users, and tasks—generating compliance-ready audit trails for multi-agent deployments.
This is a transparent proxy layer that sits between your AI agents and LLM APIs (OpenAI, Anthropic, local models, etc.). It automatically tags every request with agent identity, user attribution, task context, and cost, then logs everything to a queryable audit database. It solves the core problem revealed by the VS Code Copilot attribution drama: "Who authorized this AI action and what data did it use?" Unlike cost-monitoring tools, this focuses on consent tracking, regulatory compliance, and multi-agent accountability.
agent-attr proxy start --port 8080 --log-db audit.db# Clone and install
git clone https://github.com/yourusername/agent-cost-attribution-layer.git
cd agent-cost-attribution-layer
pip install -e .
# Copy environment template
cp .env.example .env
# Start the proxy server
agent-attr proxy start --port 8080 --log-db ./audit.db
docker-compose up -d
The proxy is now listening on http://localhost:8080.
Before:
from openai import OpenAI
client = OpenAI(api_key="sk-...")
response = client.chat.completions.create(model="gpt-4", messages=[...])
After (one-line change):
from openai import OpenAI
client = OpenAI(api_key="sk-...", base_url="http://localhost:8080/v1")
# Add attribution headers
client.default_headers = {
"X-Agent-ID": "code-review-bot",
"X-User-ID": "user-123",
"X-Task-Context": "PR review #456"
}
response = client.chat.completions.create(model="gpt-4", messages=[...])
# Get all actions by a user in the last 30 days
curl http://localhost:8080/audit/user/user-123?days=30
# Get all actions by an agent
curl http://localhost:8080/audit/agent/code-review-bot
# Export as CSV (for compliance)
curl http://localhost:8080/audit/export/csv?start_date=2026-05-01&end_date=2026-05-31 > audit.csv
# Start proxy
agent-attr proxy start --port 8080 --log-db audit.db
# Query logs
agent-attr audit query --agent code-review-bot --days 7
# Export for compliance
agent-attr audit export --format csv --output audit.csv
# GDPR deletion
agent-attr audit delete --user user-123
MIT
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.0 | 3 May 2026 | 17 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 21:44 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:e732dd87913a86c94c0a7cca8dce0cc582a8baa88b785426249592687e98e429