Skip to content

Commit 60ab92d

Browse files
Add webhooks, policy templates, and usage quotas (2096 -> 2333 tests)
Three new features to strengthen the Auth0 hackathon submission: - Webhook notifications: HMAC-signed alerts for 17 security event types - Policy templates: 8 pre-built security profiles with risk assessment - Usage quotas: daily/monthly/total token budgets with configurable actions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2422a30 commit 60ab92d

10 files changed

Lines changed: 3447 additions & 1 deletion

File tree

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ AgentGate uses Auth0 Token Vault to provide a secure, observable layer between A
2929
| **Compliance Reports** | SOC2/GDPR-ready audit exports with risk scoring |
3030
| **Agent Delegation** | Agents can delegate narrowed permissions to sub-agents with depth limits |
3131
| **Policy Simulation** | Dry-run authorization checks without issuing tokens |
32+
| **Webhook Notifications** | Real-time alerts for security events (HMAC-signed, auto-retry) |
33+
| **Policy Templates** | Pre-built security profiles for common use cases |
34+
| **Usage Quotas** | Daily/monthly token budgets with configurable actions on exceed |
3235

3336
## Architecture
3437

@@ -134,6 +137,31 @@ See [AUTH0_SETUP.md](AUTH0_SETUP.md) for detailed instructions.
134137
- `GET /api/v1/analytics?hours=24` - Token usage analytics with anomaly detection
135138
- `GET /api/v1/compliance?days=30` - SOC2/GDPR compliance audit report
136139

140+
### Webhook Notifications
141+
- `POST /api/v1/webhooks` - Create a webhook subscription (returns HMAC secret)
142+
- `GET /api/v1/webhooks` - List webhook subscriptions
143+
- `GET /api/v1/webhooks/{id}` - Get webhook details
144+
- `PATCH /api/v1/webhooks/{id}` - Update a webhook
145+
- `DELETE /api/v1/webhooks/{id}` - Delete a webhook
146+
- `POST /api/v1/webhooks/{id}/rotate-secret` - Rotate HMAC secret
147+
- `GET /api/v1/webhooks/{id}/deliveries` - View delivery history
148+
- `GET /api/v1/webhooks/events/list` - List all available event types
149+
150+
### Policy Templates
151+
- `GET /api/v1/templates` - List available templates (filter by category, risk, tag)
152+
- `GET /api/v1/templates/{id}` - Get template details
153+
- `GET /api/v1/templates/{id}/preview` - Preview policy + risk assessment
154+
- `GET /api/v1/templates/compare/{a}/{b}` - Compare two templates side by side
155+
- `POST /api/v1/templates/apply` - Create a policy from a template with overrides
156+
157+
### Usage Quotas
158+
- `POST /api/v1/quotas` - Create a usage quota (daily/monthly/total)
159+
- `GET /api/v1/quotas` - List all quotas
160+
- `GET /api/v1/quotas/check/{agent_id}` - Check quota status
161+
- `DELETE /api/v1/quotas/{id}` - Delete a quota
162+
- `POST /api/v1/quotas/{id}/reset` - Reset quota counter
163+
- `GET /api/v1/quotas/{id}/history` - View usage history
164+
137165
## Security Features
138166

139167
### Anomaly Detection

SUBMISSION.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ AgentGate is built entirely on Auth0 primitives:
4444
| Emergency revoke | Kill switch to instantly disable all agent policies and revoke all keys |
4545
| Agent delegation | Agents delegate narrowed scopes to sub-agents with depth limits and cascade revocation |
4646
| Policy simulation | Dry-run authorization checks return detailed pass/fail report without issuing tokens |
47+
| Webhook notifications | HMAC-signed real-time alerts for 17 security event types with auto-disable on failures |
48+
| Policy templates | 8 pre-built security profiles (read-only, dev, CI/CD, admin, paranoid) with risk assessment |
49+
| Usage quotas | Daily/monthly/total token budgets with configurable actions (deny, warn, step-up) |
4750
| API key hashing | Keys are SHA-256 hashed at rest. Raw keys shown only once at creation |
4851
| Token rotation | Token Vault handles automatic refresh and rotation |
4952
| Audit logging | Every token request, policy change, and connection event is logged |
@@ -65,7 +68,7 @@ AgentGate is built entirely on Auth0 primitives:
6568
- **Policy engine**: Eight-stage enforcement (existence, active status, ownership, expiration, time windows, IP allowlist, service authorization, scope validation, rate limiting)
6669
- **Dual authentication**: Session-based auth for dashboard users, API key auth (Bearer tokens) for agents
6770
- **Agent-key binding**: API keys are bound to specific agents -- an agent cannot use another agent's key to request tokens
68-
- **Test suite**: 1,896 tests across 51 test files covering policy enforcement, CIDR IP validation, time windows, rate limiting, scope intersection, multi-tenant isolation, security injection, API key lifecycle, audit trails, agent delegation chains, policy simulation, and edge cases
71+
- **Test suite**: 2,333 tests across 61 test files covering policy enforcement, CIDR IP validation, time windows, rate limiting, scope intersection, multi-tenant isolation, security injection, API key lifecycle, audit trails, agent delegation chains, policy simulation, webhook notifications, policy templates, usage quotas, and edge cases
6972
- **Type safety**: Pydantic models for all API requests, dataclasses for domain objects
7073
- **Starlette TemplateResponse**: Updated to current API format (no deprecation warnings)
7174

@@ -101,6 +104,9 @@ Auth0's Token Vault, CIBA, and Connected Accounts already provide the building b
101104
- Policy engine = the missing layer that maps agent identity to permitted actions
102105
- Delegation chains = safe agent-to-agent permission sharing with scope narrowing at every hop
103106
- Policy simulation = debuggable authorization without side effects
107+
- Webhook notifications = real-time incident response for security teams
108+
- Policy templates = security best practices encoded as reusable profiles
109+
- Usage quotas = budget-based access control for cost and risk management
104110

105111
## Architecture
106112

0 commit comments

Comments
 (0)