Schedule a call

Control what your AI can do
One function at a time

Secure your LLM tools with deterministic guardrails and function-level authorization. One decorator, instant security. Zero infrastructure.

Python SDK - Get started in 30 seconds
1. Install & Initialize
$pip install'd2-sdk[all]'
# Generate local policy
python -m d2 init
2. Protect Your Tools
# In your app startup
await configure_rbac()
@d2_guard("weather_api")
def get_weather(location: str):
return weather_service.fetch(location)
# Set user context
set_user("alice", roles=["developer"])
# Clear when done
clear_user_context()
Ready to get started?

From Complex to Simple

Replace hundreds of lines of authorization logic with a single decorator.

Before D2
# Hundreds of lines of auth logic
def get_weather(user,location):
if not user:
raise PermissionError
if user.role not in ["admin", "weather"]:
raise PermissionError
if not validate_permissions(user):
raise PermissionError
# ... and more
return weather_service.fetch(location)
With D2
# Complete setup
@d2_guard("weather_api")
def get_weather(location: str):
return weather_service.fetch(location)
# Set context
set_user("alice", roles=["developer"])
# Clear when done
clear_user_context()

Built for Production AI Systems

Runtime-optimized authorization that identifies security issues at the code level, not just endpoints.

One Decorator

Just add @d2_guard to your functions. Extremely simple code that replaces hundreds of lines of auth logic.

Declarative Policies

Define all authorization logic in YAML/JSON policy files—no code changes needed. Updates propagate in under a minute. Policy validation catches typos before they reach production.

Three layers of deterministic guardrails: RBAC controls who can call what, input/output validation, and sequence enforcement prevents multi-step attacks.

Predictable, rule-based security controls. Input validation constrains function arguments. Output sanitization removes PII. All decisions are deterministic and auditable—no probabilistic judgments.

Runtime Optimized

Built for high-performance production systems with minimal overhead and intelligent caching.

Full Observability

Every authorization decision emits telemetry. Track denials, sequence violations, and sanitization actions. OpenTelemetry integration for production monitoring and debugging.

Your Control Center

View telemetry, edit policies, download events, and more.

D2 Policy Engine Dashboard - Real-time event monitoring

Event Monitoring

Track every authorization decision in real-time

D2 Policy Engine Analytics Dashboard

Analytics & Insights

Visualize patterns and performance metrics

D2 Policy Engine Visual Policy Editor

Visual Policy Editor

Create and edit authorization policies easily

D2 Policy Engine API Token Management

API Token Management

Manage tokens and authentication securely

Free to start

Simple, Transparent Pricing

Start free with local mode. Scale to cloud for production with enterprise features.

Free
$0

Perfect for development

3 tools per app
1 published app
15-minute policy refresh
1 team member
Essentials
$99

Per month

10 tools per app
2 published apps
5-minute policy refresh
3 team members
Most Popular
Pro
$249

Per month

100 tools per app
10 published apps
30-second policy refresh
10 team members
Enterprise
Custom

For large organizations

Custom
Custom
Custom
Custom

All plans include:

File-based policies
CLI tools included
Community support
Local development mode

Ready to Secure Your AI Agents?

Tell us about your use case and we'll help you get started.