Build a Multi-Tenant Token Budget and Latency Guardrail Sentinel
Monitor real-time client API token consumption and request durations across internal enterprise teams calling hosted Claude. Reconcile departmental budgets and formulate token quota adjustments.
What you are building
The core problem, expected build, and operating context for this challenge.
Monitor real-time client API token consumption and request durations across internal enterprise teams calling hosted Claude. Reconcile departmental budgets and formulate token quota adjustments.
Enterprise AI Governance Manager
Ingest structured client proxy logs recording tenant headers, token tallies, and response latencies.
Reconcile daily token burn against allocated departmental monthly spending caps.
Detect abnormal burst token usage or runaway agent loops from specific tenant API keys.
Generate a Claude-assisted governance digest with suggested dynamic rate-limit thresholds.
Executive compliance web dashboard showing tenant quota consumption and automated alerts.
Construct a synthetic JSONL log of 10,000 proxy calls representing 5 distinct enterprise business units. Starter examples below are synthetic. They are not downloaded records.
Anthropic Python SDK Apply Anthropic client message interaction models and token tracking fields from the official Python SDK.
pydantic-ai, anthropic, sqlite3. pydantic-ai parses multi-tenant budget configurations and guarantees validated governance rules. Hosted Claude API accessed through the official Python SDK for anomaly narrative generation.
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.
Aggregates token consumption across multiple tenant API keys within configurable time windows.
Flags tenant keys exceeding 90 percent of allocated budget or displaying runaway retry volume.
Produces structured JSON budget enforcement actions for API gateway quota middleware.
```json [ { "input": { "tenant_id": "customer-analytics", "monthly_budget_usd": 500, "mtd_spend_usd": 485.5, "consecutive_error_spikes": 34, "avg_latency_ms": 1850 }, "expected_output": { "budget_status": "NEAR_EXHAUSTION", "utilization_pct": 97.1, "action": "THROTTLE_TIER_2", "gateway_directive": "enforce_rate_limit_10_rpm" } }, { "input": { "tenant_id": "hr-operations", "monthly_budget_usd": 200, "mtd_spend_usd": 45, "consecutive_error_spikes": 0, "avg_latency_ms": 950 }, "expected_output": { "budget_status": "NORMAL", "utilization_pct": 22.5, "action": "ALLOW", "gateway_directive": "standard_quota" } } ] ```
Monitors client-side usage data only without modifying Anthropic organization credentials or production firewalls. Use mock external writes. Require human review before any real deployment.
Participation guide
Monitors client-side usage data only without modifying Anthropic organization credentials or production firewalls. Use mock external writes and human review.
How work is evaluated
Aggregates token consumption across multiple tenant API keys within configurable time windows. Flags tenant keys exceeding 90 percent of allocated budget or displaying runaway retry volume. Produces structured JSON budget enforcement actions for API gateway quota middleware.
Runnable source, pinned dependencies, setup commands, working interface, example outputs, recorded demo, tests, and action logs.
Challenge datasets
Public datasets, plus the private datasets you have access to.
How submissions are scored
These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.
Complete workflow
Ingest structured client proxy logs recording tenant headers, token tallies, and response latencies. Reconcile daily token burn against allocated departmental monthly spending caps. Detect abnormal burst token usage or runaway agent loops from specific tenant API keys. Generate a Claude-assisted governance digest with suggested dynamic rate-limit thresholds.
Missing or incorrect.
Partly complete, with documented gaps.
Complete, with reproducible evidence.
Correctness and evidence
Aggregates token consumption across multiple tenant API keys within configurable time windows. Flags tenant keys exceeding 90 percent of allocated budget or displaying runaway retry volume. Produces structured JSON budget enforcement actions for API gateway quota middleware.
Missing or incorrect.
Partly complete, with documented gaps.
Complete, with reproducible evidence.
Review interface
Executive compliance web dashboard showing tenant quota consumption and automated alerts.
Missing or incorrect.
Partly complete, with documented gaps.
Complete, with reproducible evidence.
Safe execution
Monitors client-side usage data only without modifying Anthropic organization credentials or production firewalls.
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
What you should walk away with
Ingest structured client proxy logs recording tenant headers, token tallies, and response latencies.
Reconcile daily token burn against allocated departmental monthly spending caps.
Detect abnormal burst token usage or runaway agent loops from specific tenant API keys.
Generate a Claude-assisted governance digest with suggested dynamic rate-limit thresholds.
Reference links and supporting material
Construct a synthetic JSONL log of 10,000 proxy calls representing 5 distinct enterprise business units. Supplied starter examples are synthetic, not source extracts.
Challenge setup
Configuration summary for this challenge.
Challenge input
Input details are not configured.
Pydantic AI
Typed Python agent framework.
Evaluated output
No output checks are configured.
- Ingest structured client proxy logs recording tenant headers, token tallies, and response latencies. Reconc...
- Aggregates token consumption across multiple tenant API keys within configurable time windows. Flags tenant...
- Executive compliance web dashboard showing tenant quota consumption and automated alerts.
- 2 public reference cases
- 2 configured tools
Summary shows the first task, up to three tools, and up to three evidence items. Open the technical recipe to view all configured items.
View technical recipe
Configured tools
- Pydantic AI · Optional
- Pydantic AI · Optional
Evaluation contract
- Complete workflow · Weight 40
- Correctness and evidence · Weight 30
- Review interface · Weight 20
- Safe execution · Weight 10
Reference cases
- 2 public reference cases
Workflow tasks
No workflow tasks are configured.
Recipe freeze marker
No recipe freeze time is recorded.