SwiftAPI is a trust authority for governing autonomous AI execution via cryptographic attestations and mandatory enforcement points.
AI Agent
│
▼
SwiftAPI Trust Authority (swiftapi.ai)
│ ── issues signed attestations
▼
Mandatory Enforcement Point (K8s Admission, Proxy, Gateway)
│
▼
Execution Allowed or Denied
SwiftAPI does not execute actions. It does not run agents. It does not bypass enforcement. It issues verifiable permission artifacts that external enforcement points validate before allowing execution.
The recommended way to integrate SwiftAPI is via the official Python SDK. It handles cryptographic verification, fail-closed logic, and revocation checks automatically.
pip install swiftapi-pythonWrap your dangerous functions in the Enforcement guard. This ensures no action runs without a signed attestation from the Authority.
from swiftapi import SwiftAPI, Enforcement
# Initialize with your Authority Key
api = SwiftAPI(key="swiftapi_live_...")
guard = Enforcement(api)
def destructive_action():
# This code is effectively dead unless SwiftAPI unlocks it
print("Dropping production database...")
# Execute with Governance
try:
guard.run(
func=destructive_action,
action="database_drop",
intent="Schema cleanup script"
)
except Exception as e:
print(f"BLOCKED: {e}")
# Output: "Blocked by policy 'no_database_drop'"Change one import. Every inference call is now attested. No other code changes required.
from openai import OpenAI
client = OpenAI(api_key="sk-...")from swiftapi import OpenAI
client = OpenAI(
swiftapi_key="swiftapi_live_...",
openai_key="sk-..."
)You bring both keys. SwiftAPI governs. OpenAI executes. The SDK attests each call with the trust authority, then calls OpenAI directly with your own key. Your credits. Your model. SwiftAPI just decides whether it happens.
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)
# If policy denies: empty string (void)
# If approved: normal completion from OpenAIIf the authority denies the action, the response content is an empty string. No error. No exception. Void. The action never happened. Your OpenAI key is never sent to SwiftAPI.
Same pattern. Change one import. Every Claude call is now attested.
from anthropic import Anthropic
client = Anthropic(api_key="sk-ant-...")from swiftapi import Anthropic
client = Anthropic(
swiftapi_key="swiftapi_live_...",
anthropic_key="sk-ant-..."
)You bring both keys. SwiftAPI governs. Anthropic executes. The SDK attests each call with the trust authority, then calls Anthropic directly with your own key. Your credits. Your model. SwiftAPI just decides whether it happens.
response = client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}]
)
print(response.content[0].text)
# If policy denies: empty string (void)
# If approved: normal completion from AnthropicIf the authority denies the action, the response content is an empty string. No error. No exception. Void. The action never happened. Your Anthropic key is never sent to SwiftAPI.
Authority keys grant the ability to exercise governance over the trust authority.
| Key Type | Purpose |
|---|---|
Recovery | Emergency root. Offline storage recommended. Can revoke owner keys. |
Owner | Manages authority, policies, grants, and regular keys. |
Regular | Scoped authority for automation, systems, or delegated access. |
swiftapi_live_[64 hex chars]Each authority key is granted specific scopes that define its capabilities.
| Scope | Capability |
|---|---|
verify | Issue and revoke execution attestations |
grants | Create and revoke delegated authority |
policy | Propose, approve, and activate policy bundles |
admin | Manage authority keys and access denial logs |
A key without the required scope cannot exercise that authority under any circumstance.
SwiftAPI enforcement is mandatory when integrated with a Mandatory Enforcement Point (MEP) such as:
In a correctly deployed environment, execution physically cannot occur without a valid SwiftAPI attestation.
Attestations are cryptographically signed tokens that authorize specific actions.
| Property | Value |
|---|---|
| Signing Algorithm | Ed25519 (EdDSA) |
| Token Format | Base64URL encoded header.payload.signature |
| Default TTL | 48 hours (172800 seconds) |
| Replay Defense | Unique JTI per attestation |
| Revocation | Pull-based via /attestation/revocations |
All governance events are logged and cryptographically signed:
All governance events are cryptographically signed and non-repudiable.
SwiftAPI is exclusively a trust authority. It issues verifiable governance artifacts. Enforcement is delegated to external systems.
Authority keys with verify scope are issued instantly at getswiftapi.com/request.
For enterprise access with custom policies, HSM-backed keys, and additional scopes, contact the authority operator directly.
| Endpoint | Method | Description |
|---|---|---|
/ | GET | Authority metadata and public key |
/health | GET | Health check |
/attestation/info | GET | Attestation format and TTL information |
/attestation/verify | POST | Verify an attestation (rate limited) |
/attestation/revocations | GET | List of revoked attestation JTIs |
/policies | GET | Active policy bundles |
| Endpoint | Method | Scope | Description |
|---|---|---|---|
/verify | POST | verify | Issue an execution attestation |
/attest | POST | verify | Issue attestation with action data (for SDK and proxy flows) |
/chat/vibe | POST | verify | Attestation-gated OpenAI Chat Completions proxy |
/attestation/revoke | POST | verify | Revoke an attestation by JTI |
/grants | POST | grants | Create a delegated grant |
/grants/{id} | DELETE | grants | Revoke a grant |
/policy/bundles | POST | policy | Upload a policy bundle |
/policy/proposals | POST | policy | Create a policy proposal |
/policy/activate | POST | policy | Activate a policy bundle |
/authority/keys | POST | admin | Create a new authority key |
/authority/denials | GET | admin | View denial log |
All protected endpoints require the X-SwiftAPI-Authority header with a valid key.