Skip to main content

Developer docs

Seal your first agent action.

Add RANKIGI beside an agent, submit one witnessed event, and verify the resulting chain outside RANKIGI.

terminal
npm install @rankigi/sdk

01

Install the SDK

Add RANKIGI to the agent runtime.

02

Wrap one action

Inputs and outputs are hashed, signed, and chained.

03

Export the proof

Download the chain bundle for review.

04

Verify locally

Recompute the chain without trusting RANKIGI.

Quickstart

One wrapped function becomes a receipt.

The SDK is non-blocking. If RANKIGI is unavailable, your agent continues and the SDK records the transport failure.

.env setup
# Enroll an agent and write .env automatically (recommended):
npx @rankigi/cli init

# That writes one credential token, which Rankigi.fromEnv() reads:
RANKIGI_CREDENTIAL=rnk_live_cred_v1...   # API key + agent + passport + signing key
RANKIGI_CHAIN_ID=...                      # optional

# Or set the four variables individually instead of RANKIGI_CREDENTIAL:
RANKIGI_API_KEY=...        # from rankigi.com/dashboard/keys (same key the curl example uses)
RANKIGI_AGENT_ID=...
RANKIGI_PASSPORT_ID=...
RANKIGI_SIGNING_KEY=...
seal-first-event.ts
import "dotenv/config";
import { Rankigi } from "@rankigi/sdk";

const rankigi = Rankigi.fromEnv();

const result = await rankigi.wrap(
  "first-tool-call",
  { tool: "send_email", to: "customer@example.com" },
  async () => {
    return { status: "sent", provider_id: "msg_abc123" };
  },
);

await rankigi.close();
console.log(result);

Verification

Do not trust the dashboard.

Export the chain and recompute it locally. The browser verifier and verify.py are the same product promise in two forms.

Open browser verifier
verify locally
# Export a chain bundle from the dashboard, then verify it locally.
python3 verify.py chain-export.json

# Or paste the sample bundle into:
# https://rankigi.com/verify

Trust model

What RANKIGI proves.

RANKIGI produces a tamper-evident, externally time-anchored audit trail of the actions an AI agent reports. Every recorded action is signed by the agent's cryptographic passport, hash-chained in order, and anchored daily to Sigstore Rekor and an independent timestamp authority. After anchoring, no one -- including RANKIGI -- can alter, reorder, or backdate a recorded action without it being detectable by a verifier you run yourself, offline, without trusting us.

What it proves: what was claimed, in what order, and that it existed by a given time.

What it does not prove:that the agent's claim was truthful, that no actions were omitted, or that the most recent pre-anchor events (up to ~24 hours) have not been modified.

The anchoring window: events are anchored to Sigstore Rekor in daily batches. There is a window of up to 24 hours between when an event is recorded and when it is externally anchored. Events within this window are cryptographically signed and hash-chained but not yet independently timestamped by a third party. Once anchored, the record is permanent and independently verifiable.

Post-quantum identity: agent passports use a hybrid Ed25519 + ML-DSA-65 (NIST FIPS 204) signature scheme. Every passport is issued with both signatures by default; when both are present, both must verify -- an invalid post-quantum signature fails the check. The ML-DSA-65 signature is verifiable offline with verify.py (via the optional dilithium-py library) or through the API, so post-quantum identity protection does not depend on trusting RANKIGI.

This is equivalent to a tamper-evident logbook with a daily independent timestamp -- stronger than an application log, in the same evidentiary family courts already accept.

API

Use HTTP when an SDK is too much.

The ingest API accepts minimal event metadata and payload hashes. Use the SDK when you need passport signing handled for you.

curl
curl -X POST https://rankigi.com/api/ingest \
  -H "Authorization: Bearer $RANKIGI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "your-agent-uuid",
    "action": "tool_call",
    "tool": "send_email",
    "severity": "info",
    "payload": {
      "input": { "to": "customer@example.com" },
      "output": { "status": "sent" }
    }
  }'
POST
/api/ingest
Submit an event to a chain.
GET
/api/chains/[chainId]/closure-export
Export a closure bundle.
GET
/api/public/revocation
Check passport revocation without auth.
GET
/verify.py
Download the Python reference verifier.