SwiftAPI Authority Documentation

SwiftAPI is a trust authority for governing autonomous AI execution via cryptographic attestations and mandatory enforcement points.


System Overview


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.


Quick Start (Python SDK)

The recommended way to integrate SwiftAPI is via the official Python SDK. It handles cryptographic verification, fail-closed logic, and revocation checks automatically.

1. Installation

pip install swiftapi-python

2. Integration (The "Golden Loop")

Wrap 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'"

Why use the SDK?

View on PyPI


Authority Keys

Authority keys grant the ability to exercise governance over the trust authority.

Key TypePurpose
RecoveryEmergency root. Offline storage recommended. Can revoke owner keys.
OwnerManages authority, policies, grants, and regular keys.
RegularScoped authority for automation, systems, or delegated access.
Important:
  • Keys are opaque tokens. Format: swiftapi_live_[64 hex chars]
  • Only SHA-256 hashes are stored. Raw keys are never persisted.
  • Keys are delivered once. They cannot be retrieved again.
  • Revocation is immediate and irreversible.

Scopes

Each authority key is granted specific scopes that define its capabilities.

ScopeCapability
verifyIssue and revoke execution attestations
grantsCreate and revoke delegated authority
policyPropose, approve, and activate policy bundles
adminManage authority keys and access denial logs

A key without the required scope cannot exercise that authority under any circumstance.


Enforcement Model

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

Attestations are cryptographically signed tokens that authorize specific actions.

PropertyValue
Signing AlgorithmEd25519 (EdDSA)
Token FormatBase64URL encoded header.payload.signature
Default TTL300 seconds (5 minutes)
Replay DefenseUnique JTI per attestation
RevocationPull-based via /attestation/revocations

Governance Events

All governance events are logged and cryptographically signed:

All governance events are cryptographically signed and non-repudiable.


What SwiftAPI Is Not

SwiftAPI is exclusively a trust authority. It issues verifiable governance artifacts. Enforcement is delegated to external systems.


Obtaining Authority

Authority keys are issued intentionally via human review at getswiftapi.com/request.

There is no self-service signup. Access is granted at the discretion of the authority operator.


Endpoints Reference

Public Endpoints

EndpointMethodDescription
/GETAuthority metadata and public key
/healthGETHealth check
/attestation/infoGETAttestation format and TTL information
/attestation/verifyPOSTVerify an attestation (rate limited)
/attestation/revocationsGETList of revoked attestation JTIs
/policiesGETActive policy bundles

Protected Endpoints (Require Authority Key)

EndpointMethodScopeDescription
/verifyPOSTverifyIssue an execution attestation
/attestation/revokePOSTverifyRevoke an attestation by JTI
/grantsPOSTgrantsCreate a delegated grant
/grants/{id}DELETEgrantsRevoke a grant
/policy/bundlesPOSTpolicyUpload a policy bundle
/policy/proposalsPOSTpolicyCreate a policy proposal
/policy/activatePOSTpolicyActivate a policy bundle
/authority/keysPOSTadminCreate a new authority key
/authority/denialsGETadminView denial log

All protected endpoints require the X-SwiftAPI-Authority header with a valid key.