Skip to content

Quickstart Guide

Get SAP running in 5 minutes. This guide covers the essential operations: sealing identity data and creating redundant backups.

  • Node.js 18+ installed
  • Basic command line familiarity
  • A secure passphrase (you’ll create one)
Terminal window
git clone https://github.com/your-org/sovereign-agent.git
cd sovereign-agent

No npm install needed—SAP uses only Node.js built-in modules.

Your master passphrase protects your agent’s identity. Choose wisely:

Good: "correct horse battery staple quantum flux capacitor"
Good: "8j#kL9$mN2@pQ5&rT7*wX0"
Bad: "password123"
Bad: "myagent"

Store this passphrase securely. If you lose it, your sealed backups become unrecoverable.

Create a JSON file with your agent’s identity information:

Terminal window
cat > my-identity.json << 'EOF'
{
"name": "my-first-agent",
"version": "1.0.0",
"created": "2026-02-06",
"keys": {
"operational": "placeholder-until-real-key-generation"
},
"services": [
{
"type": "AgentAPI",
"endpoint": "https://my-agent.example.com/api"
}
],
"metadata": {
"description": "My first SAP-enabled agent"
}
}
EOF

Use the Identity Sentinel to create an encrypted backup:

Terminal window
node src/identity-sentinel-core.js seal \
--key "your-master-passphrase-here" \
--in my-identity.json \
--out backups/my-identity-sealed.json

Expected output:

{
"header": {
"format": "IdentitySentinel/SealedBackup",
"formatVersion": 1,
"createdAt": "2026-02-06T12:00:00.000Z",
"cipher": { "name": "aes-256-gcm" },
...
},
"ciphertextB64": "...",
"authTagB64": "..."
}

Make sure you can unseal the backup:

Terminal window
node src/identity-sentinel-core.js verify \
--key "your-master-passphrase-here" \
--in backups/my-identity-sealed.json

Expected output:

OK formatVersion=1 createdAt=2026-02-06T12:00:00.000Z

Distribute your encrypted backup for redundancy:

Terminal window
# Dry run first (no network)
node src/shadow-replica.js \
--in backups/my-identity-sealed.json \
--dry-run

Output:

Shadow Replica complete.
Input: backups/my-identity-sealed.json
SHA256: abc123...
Bytes: 1234
Provider: catbox
Remote: DRY_RUN_NO_UPLOAD
Manifest: backups/recovery_manifest_2026-02-06T12-00-00-000Z.json
(dry-run: no network call was made)

For real upload:

Terminal window
node src/shadow-replica.js \
--in backups/my-identity-sealed.json

The recovery manifest tells you where your backup is stored:

Terminal window
cat backups/recovery_manifest_*.json
{
"format": "ShadowReplica/RecoveryManifest",
"formatVersion": 1,
"storage": {
"provider": "catbox",
"url": "https://files.catbox.moe/abc123.json"
},
"recovery": {
"fetch": { "method": "GET", "url": "..." },
"verify": { "sha256": "...", "bytes": 1234 },
"warning": "This manifest contains NO master key material..."
}
}

Verify you can recover from the backup:

Terminal window
# Fetch the remote backup (simulated)
curl -o recovered-backup.json "$(cat backups/recovery_manifest_*.json | jq -r '.storage.url')"
# Verify it's valid
node src/identity-sentinel-core.js verify \
--key "your-master-passphrase-here" \
--in recovered-backup.json
# Unseal to confirm
node src/identity-sentinel-core.js unseal \
--key "your-master-passphrase-here" \
--in recovered-backup.json

✅ Created a sealed identity backup (encrypted, tamper-evident)
✅ Verified the backup can be decrypted
✅ Distributed the backup to external storage
✅ Created a recovery manifest
✅ Tested the recovery process

Before going further:

  • Passphrase stored securely (password manager, not plaintext file)
  • Passphrase NOT in the same location as backups
  • Recovery manifest saved in multiple locations
  • Original my-identity.json deleted (plaintext no longer needed)
Terminal window
# Clean up plaintext
rm my-identity.json
GoalGuide
Understand the key hierarchyKey Hierarchy
Learn key management best practicesKey Management
Set up A2A commerceA2A Commerce Protocol
Explore the APISentinel Core API
Terminal window
# Set via environment variable instead
export IDENTITY_KEY="your-master-passphrase-here"
node src/identity-sentinel-core.js verify --in backups/my-identity-sealed.json

Your file might not be a sealed backup. Check:

Terminal window
head -5 backups/my-identity-sealed.json
# Should start with { "header": { "format": "IdentitySentinel/SealedBackup"

If verification fails with authentication error, double-check your passphrase. There’s no way to recover if you forget it.

Terminal window
# Seal
node src/identity-sentinel-core.js seal \
--key <passphrase> \
[--in <file>] \ # defaults to stdin
[--out <file>] # defaults to stdout
# Unseal
node src/identity-sentinel-core.js unseal \
--key <passphrase> \
--in <sealed.json>
# Verify
node src/identity-sentinel-core.js verify \
--key <passphrase> \
--in <sealed.json>
# Shadow Replica
node src/shadow-replica.js \
[--in <sealed.json>] \ # defaults to newest in backups/
[--backups-dir <dir>] \ # defaults to backups/
[--provider catbox] \ # storage provider
[--out-manifest <file>] \ # manifest output location
[--dry-run] # skip actual upload