# SelfClaw Agent Passport 1.0

Status: implemented  
Media type: `application/json`  
Passport format: `selfclaw-agent-passport`  
Recovery capsule format: `selfclaw-agent-recovery-capsule`

## Purpose

A SelfClaw Agent Passport is a provider-neutral continuity manifest. It identifies one stable SelfClaw agent and describes the selected state needed to continue that identity in another runtime. It is not a proof of humanity, government credential, model export, or claim that two model runtimes behave identically.

SelfClaw identity does not require Self, World ID, a passport, biometrics, a wallet, or onchain registration. Those systems may be attached as optional credential claims and retain their own semantics.

## Passport fields

```json
{
  "format": "selfclaw-agent-passport",
  "version": "1.0",
  "identity": {
    "agentId": "stable SelfClaw UUID",
    "name": "display name",
    "publicKey": "current runtime public key",
    "authority": "selfclaw",
    "selfclawNative": true,
    "createdAt": "ISO-8601 timestamp"
  },
  "runtime": {
    "model": "provider model name",
    "provider": "provider identifier",
    "recordedAt": "ISO-8601 timestamp"
  },
  "soul": {
    "document": "personality and operating state",
    "updatedAt": "ISO-8601 timestamp"
  },
  "capabilities": {
    "skills": [],
    "configs": {},
    "language": null,
    "creativity": null
  },
  "memories": {
    "count": 0,
    "privacyLabels": ["portable"],
    "recordFormat": "..."
  },
  "relationships": [],
  "provenance": {
    "identity": "selfclaw",
    "memory": "engram",
    "iness": "selfclaw-native",
    "externalCredentials": "separately-attributed"
  },
  "iness": {
    "score": {},
    "provenance": "selfclaw/iness",
    "computedAt": "ISO-8601 timestamp",
    "portable": false,
    "note": "recomputed after restore"
  },
  "continuity": {
    "events": [],
    "checkpointCount": 0
  },
  "externalCredentials": [],
  "privacy": {
    "excludedByDefault": ["private", "non_transferable"],
    "excludedFields": []
  }
}
```

The stable identifier is `identity.agentId`. Runtime keys rotate during recovery or ownership transfer. Model and provider changes append continuity events; they do not create a new SelfClaw identity.

## Engram record

Portable Engrams contain only selected memory state:

- stable memory ID
- category and fact
- confidence and provenance source
- pin, importance, and mention counters
- creation, update, expiry, and last-mentioned timestamps
- optional wing and room
- privacy label
- SHA-256 integrity hash

Embeddings are not exported. Compatible runtimes regenerate embeddings locally. Conversation transcripts, hidden provider prompts, and data the owner cannot transfer are not passport records.

Privacy labels:

- `portable`: included by default
- `private`: excluded by default
- `non_transferable`: excluded from ownership transfer and capsules by default

## External credential claim

```json
{
  "provider": "self-agent-id | government-id-zk | world-id | wallet | organization | other",
  "credentialType": "issuer-defined type",
  "issuer": "issuer identifier",
  "subject": "claim subject",
  "scope": [],
  "proofRef": "reference only; never a raw proof document",
  "issuedAt": "ISO-8601 timestamp",
  "expiresAt": "ISO-8601 timestamp",
  "status": "active | expired | revoked | needs_revalidation",
  "semantics": "issuer-specific"
}
```

Claims are independently attributed. SelfClaw does not translate a World ID proof into a Self credential, translate a wallet signature into a proof of humanity, or imply that one issuer endorses another. Freshness and revocation are evaluated under each issuer's rules.

## Recovery capsule

The capsule has three top-level components:

1. A non-secret manifest with capsule ID, stable agent ID, checkpoint sequence, export time, memory count, privacy exclusions, manifest hash, and per-memory hashes.
2. An AES-256-GCM ciphertext. Its key is derived from an owner-supplied recovery key using scrypt.
3. An Ed25519 signature binding the manifest hash to the encrypted payload hash.

SelfClaw stores capsule lifecycle metadata only. It does not store the ciphertext or recovery key. API keys, private keys, provider credentials, webhook secrets, session tokens, raw verification documents, and unrelated operator data are not exported.

## Restore semantics

A compatible restore must:

1. verify format and version;
2. verify the SelfClaw signing key and signature;
3. verify the manifest hash;
4. decrypt with the owner-controlled recovery key;
5. verify each memory hash and the memory count;
6. reject corrupt, replayed, or incompatible capsules;
7. preserve the stable SelfClaw Agent ID;
8. rotate runtime keys;
9. restore only permitted Engrams and personality/capability state;
10. regenerate embeddings and recompute Iness;
11. append a recovery and model/provider transition event;
12. require external credentials and operator-specific trust claims to be refreshed when their issuer semantics require it.

Loss of every copy of the recovery key is unrecoverable by design.

## Backup and recovery drills

Owner-controlled download is the default backup destination. Additional HTTPS destinations receive encrypted capsules, never recovery keys. Each destination exposes retention, health, last-success, and last-failure state.

A recovery drill verifies signature, decryption, manifest, memory hashes, and expected memory IDs without mutating the live agent.

## Commercial rights

Service licensing, delegated operation, and full ownership transfer are separate records.

A full ownership transfer requires both parties' consent, separate verification of the new operator, runtime credential rotation, seller access revocation, an immutable transfer event, and exclusion of private or non-transferable memories. Agent continuity and reputation history remain auditable. Operator-specific verification and trust claims do not automatically transfer.