How it works

The playground takes a scenario (an agent, an action, and context) and evaluates it against your policy files. It shows every rule that matched, every condition that was checked, and the final decision — all without making real API calls.

Run the playground
$ npx openleash playground run spending-check

Example: Spending limit check

An agent attempts a $150 purchase. The policy allows up to $100 without approval.

playground output
# Scenario: agent-shop-001 / purchase / $150
Evaluating policy: spending-limits.yaml
✓ agent matches: agent-shop-001
✓ action matches: purchase
✗ condition: context.cost <= 100 → 150 > 100
→ rule result: REQUIRE_APPROVAL
Final decision: REQUIRE_APPROVAL
Obligations: ["notify_owner", "log_attempt"]
Proof token: (not issued — approval pending)

Example: Appointment booking (auto-approved)

An agent books a haircut — a low-trust action that auto-approves.

playground output
# Scenario: agent-booking-001 / book_appointment / haircut
Evaluating policy: appointments.yaml
✓ agent matches: agent-booking-001
✓ action matches: book_appointment
✓ condition: resource.trust_level == "low"
→ rule result: ALLOW
Final decision: ALLOW
Obligations: []
Proof token: v4.public.eyJhZ2VudCI6ImFnZW50LWJvb2tp...

Example: Government submission (step-up)

A regulated filing requires step-up authentication before proceeding.

playground output
# Scenario: agent-gov-001 / submit_filing / tax-return
Evaluating policy: government.yaml
✓ agent matches: agent-gov-001
✓ action matches: submit_filing
✓ condition: resource.category == "regulated"
→ rule result: REQUIRE_STEP_UP
Final decision: REQUIRE_STEP_UP
Step-up method: "owner_mfa"
Obligations: ["audit_log", "retain_30d"]
Proof token: (not issued — step-up required first)

CLI commands

playground CLI
# List available scenarios
$ npx openleash playground list
# Run a specific scenario
$ npx openleash playground run
# Run with a specific policy file
$ npx openleash playground run spending-check --policy ./policies/limits.yaml