API Reference
Complete method signatures for the Python SDK, REST management API, and webhook event schema.
Python SDK
Install with pip install runta-sdk. All objects are importable from the top-level runta module.
Policy
Represents a compiled governance policy loaded from YAML or constructed in code.
sandbox()
Context manager that wraps an agent invocation in an enforced sandbox. On exit the audit log is committed and the sandbox is torn down.
AuditLog
Returned by sb.audit_log() after the sandbox exits. All entries are hash-chained and verifiable.
REST Management API
Base URL: https://api.runtahq.com/v1. All requests require an Authorization: Bearer <api_key> header.
Runs
| Method | Path | Description |
|---|---|---|
| GET | /runs | List runs with optional filter by label or date range |
| GET | /runs/{id} | Retrieve a single run record including audit log URL |
| DELETE | /runs/{id} | Revoke a run's stored audit log after retention period |
Policies
| Method | Path | Description |
|---|---|---|
| GET | /policies | List all saved policy versions in the workspace |
| POST | /policies | Upload a new policy YAML, returns a policy_id |
| GET | /policies/{id} | Retrieve a specific policy version |
Webhook events
Runta emits signed webhook payloads for key sandbox lifecycle events. Verify with the X-Runta-Signature header using your webhook secret.
sandbox.started- run_id, policy_id, labels, timestampegress.blocked- run_id, destination, rule, timestampquota.exceeded- run_id, resource, limit, actual, timestampsandbox.completed- run_id, duration_ms, tool_calls, audit_log_url
Need something not covered here?
Runta supports custom policy extensions and SIEM integrations. Contact the engineering team.