What is AMARACUS?
Imagine your company owns valuable secrets—customer payment records, medical files, and confidential designs. In most companies, developers build their own locks and hide keys in random file drawers. If a key is lost or stolen, customer data is compromised.
AMARACUS is your Central Automated Bank Vault
- Standardized High-Security Locks: Instead of inventing locks, AMARACUS provides standardized NIST-approved AES-256-GCM, ChaCha20-Poly1305, and FIPS 203 ML-KEM algorithms out of the box.
- Key Protection: Managed keys are stored encrypted under an AMARACUS platform master key and never returned by the API. If you need keys held in hardware you control, bring your own Azure Key Vault or Managed HSM (preview).
- Automated Security Guards: AMARACUS checks company rulebooks (Policies) before allowing anyone to lock or unlock data.
- Immutable Flight Recorder: Every lock, key, and action is permanently recorded in an unalterable audit log.
Universal Cryptographic Integration Guide
How any modern platform, AI ecosystem (e.g. Gemini, OpenAI), fintech, or healthcare application secures passwords, conversations, and customer records using AMARACUS in 4 simple steps:
Step 1: Create a Dedicated Project in AMARACUS
Every sensitive data domain gets its own isolated project boundary. For example, create “User Passwords” for credential hashing and “AI Chat Conversations” for message encryption. This enforces strict multi-tenant isolation so that billing allowances, audit trails, and security keys remain segregated by project.
Step 2: Issue an API Credential (Digital Security Badge)
Navigate to Build → API Credentials and generate a secret key (e.g. am_live_a1b2c3d4...). Copy and save this credential in your server environment variables (AMARACUS_API_KEY). Client web browsers never see this key.
Step 3: Choose the Right Cryptographic Pattern
POST /v1/encrypt with a managed key. Store the returned envelope next to your ciphertext and unwrap it with POST /v1/decrypt when you need to read the data.Step 4: Call the Universal API in Your Codebase
Whether your backend is written in TypeScript, Python, Go, Java, or Rust, interact with the AMARACUS REST API or official SDK with just 5 lines of code. Every operation is recorded in your organization's audit log.
Projects & Environments
A Project represents an application or business unit (such as Billing Service or Customer App). Each Project contains three isolated rooms:
The engineering workshop. Safe to test prototypes without touching real customer data.
The dress-rehearsal room where systems are verified right before going live.
The live, real-world system. Live customer data lives strictly inside this environment.
Note: Starter includes 2 projects, Pro 10 and Business 50, each with all 3 environments. An account needs an active plan before it can create keys or call the API.
Team Roles & Permissions
AMARACUS follows the principle of least privilege—employees only get access to what they need for their job:
API Keys (Digital Security Badges)
Software systems use API keys instead of passwords. To protect against leaks, AMARACUS displays the secret key only once when you create it. After that, it is permanently concealed.
Navigate to Build → API Credentials to create and manage digital badges.
Cryptography Playground
Test real digital locks without writing code! Go to Build → Cryptography Playground:
- Encrypt / Decrypt: Scramble text into an authenticated ciphertext envelope and unlock it back.
- Hash: Generate an unforgeable 64-character digital fingerprint of any message.
- Digital Signatures: Put an unforgeable digital wax seal on approvals and contracts.
Key Management & Automatic Rotation
Security standards require encryption keys to be rotated every 90 days. When you rotate a key in AMARACUS:
- New data is automatically encrypted with Version 2.
- Historical data previously encrypted with Version 1 still decrypts safely because the historical version chain is preserved.
- Zero private key material is ever exposed to the web browser.
Post-Quantum Cryptography (PQC)
Future quantum computers will be able to crack traditional mathematical locks (like RSA). AMARACUS includes the new 2024 NIST-approved quantum-resistant algorithms: ML-KEM (for encryption) and ML-DSA (for signatures). You can inspect them in Cryptography → Algorithm Registry.
Health Score & CBOM
Go to Cryptography → Crypto Intelligence & CBOM to view your company's security credit score (from 0 to 100). The dashboard alerts you if keys are overdue for rotation, if certificates are expiring soon, or if any outdated algorithms are detected.
Global Production & 24/7 Reliability
How AMARACUS stays online, resilient, and fast at massive scale without losing your data or slowing down:
24/7 High Availability (No Single Point of Failure)
AMARACUS runs across multiple duplicate servers and data centers. If one machine crashes, the others take over traffic instantly without dropping a single user request.
Self-Healing Background Jobs (Zombie Recovery)
If an unexpected server reboot happens right in the middle of a large cryptographic operation, our automated recovery watchdog detects the abandoned task within 60 seconds and smoothly restarts or rescues it, ensuring zero lost tasks.
Provider Circuit Breakers (Overload Protection)
Just like the electrical circuit breaker in your house protects against power surges, AMARACUS monitors cloud providers (like Azure Key Vault or Hardware Security Modules). If an upstream provider throttles requests, the circuit breaker protects the system from traffic pile-ups and safely fails over.
Rolling Deployment Architecture
Whenever we release security updates or new cryptographic algorithms, the new version launches alongside the existing version and verifies health checks before retiring the old one to minimize maintenance disruptions.
Connecting Your Apps & Webhooks
How AMARACUS easily talks to your websites, databases, internal company tools, and partner apps:
The Walkie-Talkie (What are Webhooks?)
Instead of having your website constantly refresh and ask: “Is the encryption job finished yet?”, webhooks are like a private walkie-talkie. The exact millisecond a key rotates, a contract is signed, or an alert triggers, AMARACUS rings your app instantly with the result.
The Unforgeable Wax Seal (HMAC Signatures)
How does your system know a notification genuinely came from AMARACUS and not a hacker? AMARACUS stamps each notification with a mathematical wax seal (an HMAC signature). If anyone tries to alter the data or replay an old message, the seal breaks and your system safely ignores it.
Pre-Built Adapters for Express & Next.js
Your engineers don't have to write hundreds of lines of glue code. We provide ready-to-use plug-and-play middleware for popular web frameworks like Express and Next.js that verify notifications and process security events in just 3 lines of code.
Safe Storefront Rule (Zero Browser Key Exposure)
Think of your website frontend like a store display window. You would never leave the master vault keys inside the shop window where passersby can grab them! AMARACUS enforces that master keys only live inside private, secured servers—never inside client web browsers.
Cryptographic Migration Platform
How AMARACUS helps your company smoothly upgrade older security locks, retire compromised keys, and transition to Post-Quantum cryptography without disrupting business:
The Analogy: Upgrading Locks While the Bank Stays Open
Imagine a bank deciding to replace all its mechanical combination locks with biometric scanners. You can't just shut down the bank, lock customers out of their safety deposit boxes, or throw away the old keys before verifying the new locks work. AMARACUS handles cryptographic upgrades the same way: new data gets locked with the modern locks, but the bank can still open every historical safety deposit box without interruption.
The Three Categories of Responsibility
AMARACUS is completely transparent about what can be automated versus what needs human attention:
- Category A (AMARACUS-Managed Vaults): Keys and certificates stored directly in AMARACUS. We can rotate keys and create Post-Quantum pairs; older key versions stay available for decryption.
- Category B (Connected Systems): External tools connected via our SDK or webhooks. AMARACUS provisions the new keys and notifies your systems, but your engineers approve the final switch.
- Category C (Your Own Code & Databases): Legacy code running on your private servers. We scan your inventory, generate step-by-step instructions, and flag weaknesses, but we never touch or alter your proprietary source code without you.
Never Throw Away the Old Key (Safe Reversibility)
When a key is migrated, AMARACUS marks it as “Retired for New Encryption” rather than deleting it. That means you can always decrypt historical customer records or verify past signatures. And if you ever need to rollback a migration, AMARACUS switches back to the previous key instantly with a single click.
The Four-Eyes Rule (Separation of Duties)
To prevent mistakes or unauthorized sabotage, AMARACUS strictly enforces that the person who designs or proposes a migration plan cannot be the one who approves it for production. A second authorized security officer must inspect the plan and give the green light.
Cryptographic Control Plane
How AMARACUS acts as the unified central operating cockpit for all your enterprise keys, certificates, cloud vaults, policies, and migrations:
The Analogy: The Conductor of the Symphony Orchestra
In a large enterprise, cryptography is like a symphony orchestra with dozens of instruments: one team manages Azure Key Vault, another provisions web server SSL certificates, a compliance team writes security policies, and application developers encrypt customer databases. If everyone plays independently, you get deafening noise and security gaps. AMARACUS is the conductor at the podium—ensuring every key, certificate, and cloud vault plays in perfect harmony according to your organizational score.
Verified vs. Inferred Inventory (No Guesswork)
Other security tools make guesses based on vague network traffic. AMARACUS clearly distinguishes between Verified Resources (keys and certificates stored in AMARACUS or in your connected vault) and Inferred Resources (third-party client apps spotted in logs). You always know exactly what is real and what requires investigation.
Four-Eyes Workflow Governance
High-impact actions—like rotating a database encryption key or retiring a root certificate—can never be performed by a single person in production. AMARACUS enforces that the security engineer who drafts a workflow cannot self-approve it. A second authorized security officer must inspect and sign off before execution begins.
Controlled Automation (Safe & Reversible)
Instead of dangerous “autonomous bots” that might unexpectedly break production, AMARACUS uses controlled, observable automation. It continuously monitors certificate expiration dates and key ages, queueing alerts and pre-staged renewal workflows for human review well before deadlines arrive.
Step-by-Step Tutorial: Managing Migrations & The Cryptographic OS
A beginner-friendly, non-technical walkthrough for business leaders, security officers, and operations managers. Follow this 8-step tutorial to discover your security locks, upgrade an older key to quantum-resistant standards, and observe automated watchdogs:
Discover What Security Locks You Own (Unified Inventory)
Click Cryptographic Inventory in the left sidebar. AMARACUS gathers every single key, TLS certificate, cloud vault (like Azure Key Vault or Hardware Security Modules), and algorithm rule into one single list.
Look for the Badges:
● Verified (Green): We have confirmed this key directly inside your hardware vault or database.
● Inferred (Yellow): We spotted an older system talking to your servers, so we flagged it for your team to double-check without making assumptions.
Check Your Security Health Score (Posture Overview)
Navigate to Cryptographic Posture. You will see an overall health score (e.g. 92 / 100) and a Post-Quantum readiness percentage.
Below the score, AMARACUS lists Deduplicated Findings. If three different servers report that a customer data key is over 90 days old, AMARACUS merges them into one single actionable alert: “Key Exceeds 90-Day Rotation Policy (Deduction: -5 pts)”.
Create a Migration Upgrade Plan (Upgrading to Post-Quantum)
Next to the finding, click Create Migration Plan. Give your plan a name (e.g., “Upgrade Customer Database to ML-KEM-768”).
Select your target algorithm: ML-KEM-768 (the official NIST quantum-resistant standard). AMARACUS automatically classifies your target into Category A (Directly Managed by AMARACUS), meaning our engine can automate the rotation safely.
Run a “Test Flight” (Dry-Run Simulation)
Before touching any production customer records, click Run Simulation. AMARACUS performs a dry-run test:
- Validates that your cloud provider supports the new key structure.
- Ensures your company security policies allow this upgrade.
- Validates that the plan supports deterministic rollback mechanisms if issues arise.
Four-Eyes Review & Approval (Two-Person Rule)
If Alice created this plan, she cannot approve it for production. A second authorized team member (like Bob, the CISO or Security Officer) logs into the dashboard, reviews the green simulation checkmark, and clicks Approve Plan. The status changes from Awaiting Approval to Ready.
Execute Cutover with Zero Downtime
With approval granted, click Execute Migration. Here is what happens behind the scenes in milliseconds:
- AMARACUS creates the brand-new quantum-resistant key pair.
- It runs an automatic round-trip test (locking and unlocking sample data) to verify the new lock works.
- It switches the active key pointer so that all future data gets locked with the modern key.
- The old key is retired, NOT deleted: Your historical records can still be read and decrypted with zero data loss.
The “Oh No!” Button (One-Click Instant Rollback)
What if an old partner integration suddenly cannot handle the new format? Click Rollback Migration. AMARACUS immediately flips the active pointer back to the previous key. Zero panic, zero broken databases, zero downtime.
Relax: Automated Watchdogs Keep Guard
You don't have to remember expiration dates on a calendar. AMARACUS continuously runs background watchdogs. 30 days before any certificate expires or when a key approaches 90 days of age, you receive an automated notification and a pre-staged renewal workflow ready for one-click approval.
Cryptographic Intelligence & Autonomous Optimization
Until now, security teams had to manually track hundreds of keys, certificates, and compliance policies in spreadsheets. AMARACUS Cryptographic Intelligence acts as your 24/7 automated security co-pilot. It continuously monitors your cloud vaults, flags hidden vulnerabilities, and produces plain-English recommendations backed by hard evidence.
1. Hard Evidence, No Hallucinations
Every recommendation includes exact verifiable facts: key age in days, days until TLS certificate expiry, cloud circuit-breaker trips, and actual billed costs from Polar.sh. We strictly never guess or fabricate security scores.
2. The Four-Eyes Rule (Two-Person Safety)
AI and automation can propose a fix, but they can never touch your production master keys alone. High-impact operations (like rotating a master key) enforce the Four-Eyes principle: the person who proposes the fix cannot be the person who executes it.
3. Test Flights (Dry-Run Impact Analysis)
Before touching live customer traffic, AMARACUS calculates the blast radius. It verifies that policies allow the change, checks rollback feasibility, and executes migrations designed to avoid customer service interruption.
4. Non-Destructive Key Versioning Policy
Rotating a key creates a fresh version for subsequent operations. AMARACUS preserves historical key versions so archived backups and historical records remain decryptable.
Cryptographic Trust, Compliance & Assurance
Compliance should never be a stressful once-a-year scramble. AMARACUS turns cryptographic assurance into a continuous, verifiable process. We map your actual keys, TLS certificates, and policy rules directly to SOC 2 Type II, ISO 27001, and NIST standards.
These reports are a self-assessment aid for your own audit preparation, not an audit or certification. AMARACUS itself has not completed a SOC 2 or ISO 27001 audit.
1. Verifiable Cryptographic Evidence
Every single piece of evidence is hashed using SHA-256 with timestamped chain of custody. Auditors can independently verify that your security logs and key configurations have not been modified or tampered with.
2. Zero Private Key Leakage
Compliance logs must never create new security vulnerabilities. AMARACUS automatically redacts all private key material, tokens, and customer plaintexts before evidence is recorded.
3. Four-Eyes Exception Governance
Need a temporary grace period for a legacy banking connection? Request a formal exception with compensating controls and an expiration date. An independent reviewer must sign off—self-approval is strictly prevented.
4. One-Click Audit Reports (JSON & CSV)
Export audit-ready evidence sheets in CSV for your GRC platform (Vanta, Drata) or JSON for automated pipeline verifications, complete with cryptographic validation hashes and legal auditor disclaimers.
Prompting AI Assistants with AMARACUS
When you ask AI tools (like ChatGPT, Claude, or Cursor) to build an application that handles confidential data, they frequently try to write custom encryption math themselves. This often results in weak passwords, insecure encryption keys, or vulnerabilities that expose private customer records.
Ready-to-Use Prompts for ChatGPT & Claude
"I am building a web app where users enter sensitive personal data (SSN, medical info, or credit card details). Do NOT write custom encryption functions. Instead, call the AMARACUS API at https://api.amaracus.tech/api/v1/crypto/encrypt using our server-side AMARACUS_API_KEY. Show me how to encrypt the data before saving it to my database and how to decrypt it when viewing the profile."
"Help me build a user login and signup workflow. Hash passwords locally with Argon2id (the argon2 npm package) and a unique salt; never use MD5, SHA-1 or a plain SHA-256 for passwords. Encrypt sensitive profile fields (phone, address) with AMARACUS: POST https://api.amaracus.tech/v1/encrypt with my managed keyId, store the returned envelope, and decrypt with POST /v1/decrypt. Provide a timing-safe login function in TypeScript."
Universal Cryptographic API Quickstart
Integrate AMARACUS into any application, microservice, or AI pipeline (e.g. Google Gemini, user authentication servers, chat platforms, or financial systems) using our universal cryptographic patterns.
Pattern 1: Encrypting a Sensitive Field with a Managed Key
Create a managed key once (dashboard or POST /v1/keys), then encrypt values with it. The response contains an opaque envelope string that carries the ciphertext, IV, tag and key version; store it and pass it back to decrypt. AMARACUS does not hash passwords: use a password-hashing library such as Argon2id in your own server for that.
import { Amaracus } from '@amaracus/sdk';
const client = new Amaracus({
apiKey: process.env.AMARACUS_API_KEY!, // am_live_...
});
// Encrypt: returns an opaque envelope string to store in your database
const { envelope } = await client.encrypt({
key: process.env.AMARACUS_KEY_ID!, // e.g. "key_ab12cd34"
data: '+1 555 0100',
});
// Decrypt: pass the envelope back
const { plaintext } = await client.decrypt({
key: process.env.AMARACUS_KEY_ID!,
envelope,
});import requests, os
API_KEY = os.getenv("AMARACUS_API_KEY") # am_live_...
API_URL = os.getenv("AMARACUS_API_URL", "https://api.amaracus.tech/v1")
KEY_ID = os.getenv("AMARACUS_KEY_ID")
headers = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}
enc = requests.post(f"{API_URL}/encrypt", headers=headers,
json={"key": KEY_ID, "data": "+1 555 0100"})
envelope = enc.json()["data"]["envelope"]
dec = requests.post(f"{API_URL}/decrypt", headers=headers,
json={"key": KEY_ID, "envelope": envelope})
print(dec.json()["data"]["plaintext"])Pattern 2: Sensitive Chats & PII (Envelope Encryption)
For large conversation transcripts, medical records, or customer PII, keep the bulk data local: generate a random Data Encryption Key (DEK) in your server, encrypt with AES-256-GCM, and use AMARACUS only to wrap and unwrap the 32-byte DEK with your managed key. There is no separate data-key endpoint; the DEK goes through the normal encrypt/decrypt calls.
import { Amaracus } from '@amaracus/sdk';
import crypto from 'crypto';
const client = new Amaracus({ apiKey: process.env.AMARACUS_API_KEY! });
const KEY_ID = process.env.AMARACUS_KEY_ID!;
// 1. Generate a DEK locally and encrypt the transcript with it
const dek = crypto.randomBytes(32);
const iv = crypto.randomBytes(12);
const cipher = crypto.createCipheriv('aes-256-gcm', dek, iv);
const ciphertext = Buffer.concat([cipher.update(transcript, 'utf8'), cipher.final()]);
const tag = cipher.getAuthTag();
// 2. Wrap the DEK with your AMARACUS managed key
const { envelope: wrappedDek } = await client.encrypt({ key: KEY_ID, data: dek });
dek.fill(0);
// Store { wrappedDek, iv, tag, ciphertext } in your database.
// 3. Later: unwrap the DEK and decrypt locally
const { plaintext, encoding } = await client.decrypt({ key: KEY_ID, envelope: wrappedDek });
const recovered = Buffer.from(plaintext, encoding as BufferEncoding); // binary DEKs come back as base64
const decipher = crypto.createDecipheriv('aes-256-gcm', recovered, iv);
decipher.setAuthTag(tag);
const decrypted = Buffer.concat([decipher.update(ciphertext), decipher.final()]).toString('utf8');Developer API Reference
Pass your project API key in the Authorization header:
Authorization: Bearer am_live_9a8b7c6d5e4f3g2h1Live Cryptography Playground
Execute standardized symmetric AEAD, post-quantum KEM ceremonies, and cryptographic hashes live in your browser.
Universal Encryption API
Encrypt a value with one of your managed keys. The response's data.envelope holds everything needed to decrypt it:
curl -X POST https://api.amaracus.tech/v1/encrypt \
-H "Authorization: Bearer am_live_your_key" \
-H "Content-Type: application/json" \
-d '{
"key": "key_your_key_id",
"data": "This is a secret payload"
}'
# Decrypt: send the envelope back with the same key
curl -X POST https://api.amaracus.tech/v1/decrypt \
-H "Authorization: Bearer am_live_your_key" \
-H "Content-Type: application/json" \
-d '{ "key": "key_your_key_id", "envelope": "<data.envelope from above>" }'Post-Quantum Key Encapsulation
ML-KEM-768 key encapsulation (NIST FIPS 203). The recipient generates a key pair; the sender encapsulates against the public key and gets a shared secret plus a ciphertext to send:
# 1. Recipient: generate a key pair (keep privateKey on your side)
curl -X POST https://api.amaracus.tech/v1/pqc/keypair \
-H "Authorization: Bearer am_live_your_key" \
-H "Content-Type: application/json" \
-d '{ "algorithm": "ML-KEM-768" }'
# 2. Sender: encapsulate against the public key
curl -X POST https://api.amaracus.tech/v1/pqc/encapsulate \
-H "Authorization: Bearer am_live_your_key" \
-H "Content-Type: application/json" \
-d '{ "algorithm": "ML-KEM-768", "publicKey": "<data.publicKey>" }'
# -> data.sharedSecret and data.ciphertextCloud Probes & Prometheus Metrics
AMARACUS exports cloud-native Kubernetes probes and standard Prometheus format metrics for monitoring platforms like Datadog, Prometheus, or Grafana:
# Liveness: Verifies process is alive
curl https://api.amaracus.tech/health/live
# Readiness: Verifies database connectivity and worker queues
curl https://api.amaracus.tech/health/ready# Scrape real-time node, HTTP, crypto ops, and queue metrics
curl https://api.amaracus.tech/metrics
# Sample response:
# process_resident_memory_bytes 58490880
# amaracus_crypto_operations_total{status="COMPLETED"} 1420
# amaracus_worker_queue_depth 0
# amaracus_circuit_breaker_state{provider="azure-keyvault"} 0Webhooks & SDK Framework Adapters
AMARACUS delivers real-time event notifications to external webhook listeners when cryptographic operations finish, policies trigger, or provider health changes. All webhook payloads are cryptographically signed with HMAC-SHA256 headers for authentication and replay mitigation:
curl -X POST https://api.amaracus.tech/api/v1/webhooks \
-H "Authorization: Bearer am_live_..." \
-H "Content-Type: application/json" \
-d '{
"url": "https://api.yourcompany.com/crypto-events",
"description": "Primary Security Event Ingestion",
"events": [
"operation.completed",
"operation.failed",
"policy.violation",
"key.disabled",
"provider.health.changed",
"usage.threshold.reached"
]
}'
# Response contains your unique signing secret:
# { "id": "wh_...", "secret": "whsec_...", "status": "active" }import express from 'express';
import { amaracusWebhookMiddleware } from '@amaracus/sdk';
const app = express();
// Express requires raw body for HMAC verification:
app.post(
'/webhooks/amaracus',
express.raw({ type: 'application/json' }),
amaracusWebhookMiddleware({
secret: process.env.AMARACUS_WEBHOOK_SECRET!,
toleranceSeconds: 300, // Replay attack tolerance
onEvent: async (event) => {
console.log('Received verified event:', event.type, event.data);
if (event.type === 'policy.violation') {
await notifySecurityTeam(event.data);
}
},
onError: (err, req, res) => {
console.error('Webhook verification failed:', err.message);
res.status(401).json({ error: 'Invalid HMAC signature or expired timestamp' });
}
})
);import { NextRequest, NextResponse } from 'next/server';
import { verifyNextJsWebhook } from '@amaracus/sdk';
export async function POST(req: NextRequest) {
try {
const event = await verifyNextJsWebhook(req, process.env.AMARACUS_WEBHOOK_SECRET!);
switch (event.type) {
case 'operation.completed':
console.log('Operation ID finished:', event.data.operationId);
break;
case 'provider.health.changed':
console.warn('Provider health status alert:', event.data.provider, event.data.status);
break;
}
return NextResponse.json({ received: true });
} catch (err: any) {
return NextResponse.json({ error: err.message }, { status: 401 });
}
}# Instantly generate a new signing secret for an endpoint:
curl -X POST https://api.amaracus.tech/api/v1/webhooks/wh_12345/rotate-secret \
-H "Authorization: Bearer am_live_..."
# Response returns the newly minted secret:
# { "id": "wh_12345", "secret": "whsec_new_token_..." }Cryptographic Migration Platform
Discover deprecated algorithms, calculate explainable risk scores, generate dependency graphs, run dry-run simulations, and execute audited key rotations and bulk data re-encryptions with dual-authorization and deterministic rollback:
curl -X POST https://api.amaracus.tech/api/v1/migrations/assess \
-H "Authorization: Bearer am_live_..." \
-H "Content-Type: application/json" \
-d '{
"environment": "production",
"includeCompliant": false
}'
# Response returns ranked assessment items with explainable scoring:
# {
# "summary": { "totalAssessed": 12, "highRisk": 3, "averageScore": 72.4 },
# "items": [{ "resourceId": "key-rsa-2048", "priorityScore": { "overallScore": 82 } }]
# }import { Amaracus } from '@amaracus/sdk';
const client = new Amaracus({ apiKey: 'am_live_...' });
// 1. Create Migration Plan
const plan = await client.migrations.createPlan({
name: 'Upgrade Billing Database to ML-KEM-768',
migrationType: 'PQC_TRANSITION',
sourceResourceId: 'key_billing_rsa_2048',
targetAlgorithm: 'ML-KEM-768',
proposerId: 'usr_sec_engineer_alice',
environment: 'production'
});
// 2. Run Non-Destructive Simulation
const sim = await client.migrations.simulatePlan(plan.id);
console.log('Simulation Safe:', sim.overallSafe);
console.log('Rollback Feasible:', sim.rollbackFeasibility.isReversible);# Step 1: Second officer approves (proposer != approver)
curl -X POST https://api.amaracus.tech/api/v1/migrations/plans/plan_12345/approve \
-H "Authorization: Bearer am_live_..." \
-H "Content-Type: application/json" \
-d '{ "approverId": "usr_ciso_bob" }'
# Step 2: Execute Migration (Generates target key, verifies roundtrip, updates pointer)
curl -X POST https://api.amaracus.tech/api/v1/migrations/plans/plan_12345/execute \
-H "Authorization: Bearer am_live_..." \
-H "Content-Type: application/json" \
-d '{ "executedBy": "usr_ciso_bob" }'
# Step 3: If needed, deterministic rollback:
# curl -X POST https://api.amaracus.tech/api/v1/migrations/plans/plan_12345/rollback \
# -d '{ "reason": "Downstream legacy system incompatible" }'// Re-encrypt large historical database datasets in controlled batches:
const result = await client.migrations.reEncrypt({
sourceKeyId: 'key_old_aes128',
targetKeyId: 'key_new_aes256_gcm',
envelopes: [
{ id: 'rec_001', ciphertext: 'base64_blob...', algorithm: 'AES-128-GCM' },
{ id: 'rec_002', ciphertext: 'base64_blob...', algorithm: 'AES-128-GCM' }
],
batchSize: 500
});
console.log('Re-encrypted:', result.successfulCount, 'Failed:', result.failedCount);Cryptographic Control Plane & Workflows
Query unified resource inventories across cloud vaults and HSMs, calculate consolidated security postures, orchestrate multi-step workflows from templates with four-eyes governance, and evaluate continuous automations:
import { Amaracus } from '@amaracus/sdk';
const client = new Amaracus({ apiKey: 'am_live_...' });
// Retrieve all verified cryptographic keys, certs, and cloud vaults
const inventory = await client.os.getInventory({ verifiedOnly: true });
console.log('Discovered Resources:', inventory.length);
// Sample item: { id: 'key_master_aes', type: 'KEY', verified: true, verificationSource: 'DIRECT_STORAGE' }curl https://api.amaracus.tech/api/v1/os/posture \
-H "Authorization: Bearer am_live_..."
# Response returns overall health score (0-100) and deduplicated findings:
# {
# "score": 92,
# "totalFindings": 2,
# "pqcReadinessPercentage": 60,
# "verifiedInventoryPercentage": 100,
# "findings": [
# { "code": "KEY_ROTATION_OVERDUE", "severity": "MEDIUM", "remediation": { "workflowTemplateId": "tpl_key_rotation" } }
# ]
# }// 1. Instantiate Staged Key Rotation Workflow from template
const workflow = await client.os.instantiateTemplate('tpl_key_rotation', {
name: 'Rotate Database Master Key Q4'
});
console.log('Workflow created in state:', workflow.state); // 'AWAITING_APPROVAL'
// 2. Second Officer approves workflow (server-side proposer !== approver enforcement)
const approved = await client.os.approveWorkflow(workflow.id, 'usr_security_officer_bob');
console.log('Approved state:', approved.state); // 'READY'
// 3. Execute approved workflow steps sequentially
const result = await client.os.executeWorkflow(workflow.id);
console.log('Completed all', result.steps.length, 'steps successfully!');# Trigger automated background rules check across key ages and cert validity:
curl -X POST https://api.amaracus.tech/api/v1/os/automations/evaluate \
-H "Authorization: Bearer am_live_..."
# Response:
# {
# "totalRules": 3,
# "evaluations": [
# { "rule": { "trigger": "CERT_EXPIRING" }, "triggered": false, "reason": "All certificates within validity windows" }
# ]
# }Cryptographic Intelligence & Autonomous Optimization API
Analyze cryptographic telemetry, retrieve explainable recommendations with deterministic priority scores (0–100), simulate dry-run impacts non-destructively, and execute remediations under the Four-Eyes principle:
import { Amaracus } from '@amaracus/sdk';
const client = new Amaracus({ apiKey: 'am_live_...' });
// Query active recommendations sorted by priority score
const recommendations = await client.intelligence.getRecommendations({
status: 'DETECTED',
severity: 'CRITICAL'
});
for (const rec of recommendations) {
console.log(`[${rec.priorityScore} pts] ${rec.title}`);
console.log('Observed Facts:', rec.explanation.observedFacts);
console.log('Remediation:', rec.proposedAction.type);
}// Simulate proposed action without mutating production keys:
const dryRun = await client.intelligence.dryRunRecommendation('rec-rot-master');
console.log('Downtime:', dryRun.potentialDowntime); // 'NONE'
console.log('Reversibility:', dryRun.reversibility); // 'FULLY_REVERSIBLE'
console.log('Policy Compliant:', dryRun.policyConsequences.compliant); // true
console.log('Required Approvals:', dryRun.requiredApprovals);
// ['SECURITY_OFFICER_APPROVAL', 'FOUR_EYES_SECOND_PARTY_APPROVAL']// Step 1: Officer Alice accepts the recommendation
await client.intelligence.acceptRecommendation('rec-rot-master', {
reason: 'Scheduled for Q4 key cryptoperiod renewal'
});
// Step 2: Officer Bob executes the remediation (proposer != executor)
// If Alice tries to execute, AMARACUS rejects with 403 Forbidden.
const completed = await client.intelligence.executeRecommendation('rec-rot-master');
console.log('Remediation completed! Status:', completed.status); // 'COMPLETED'# Triggers live telemetry scan across Keys, Certs, Circuit Breakers, and Policies:
curl -X POST https://api.amaracus.tech/api/v1/intelligence/analyze \
-H "Authorization: Bearer am_live_..." \
-H "Content-Type: application/json" \
-d '{ "categories": ["SECURITY_RISK", "KEY_LIFECYCLE", "PQC_READINESS"] }'
# Response:
# {
# "data": {
# "newlyDetected": 2,
# "total": 5,
# "recommendations": [...]
# }
# }Trust, Compliance & Assurance API
Evaluate technical control compliance against SOC 2 Type II, ISO/IEC 27001, NIST SP 800-53, NIST SP 800-57, FIPS 140-3, and NIST PQC. Collect verifiable SHA-256 evidence, request Four-Eyes exceptions, and export audit-ready reports:
import { Amaracus } from '@amaracus/sdk';
const client = new Amaracus({ apiKey: 'am_live_...' });
// Evaluate SOC 2 Type II compliance in real-time
const report = await client.compliance.evaluate({
frameworkId: 'SOC_2_TYPE_II',
forceRefresh: true
});
console.log('Overall SOC 2 Score:', report.overallScore + '%'); // e.g. 100%
console.log('Satisfied Controls:', report.satisfiedControls, '/', report.totalControls);
console.log('Identified Gaps:', report.gapsCount);
console.log('Cryptographic Digest:', report.reportDigest); // SHA-256 hash// Step 1: Officer Alice requests a temporary exception for a legacy connection
const exception = await client.compliance.requestException({
controlId: 'SOC2-CC6.1',
justification: 'Legacy banking mainframe batch connector migration scheduled for Q4',
compensatingControls: 'Air-gapped VPC subnet, mutual TLS 1.3, hourly log verification',
expiresAt: new Date(Date.now() + 30 * 86400000).toISOString() // 30-day grace period
});
console.log('Exception created! Status:', exception.status); // 'PENDING'
// Step 2: Independent Officer Bob approves the exception
// (If Alice attempts to approve her own exception, AMARACUS rejects with 403 Forbidden)
const approved = await client.compliance.approveException(exception.id, 'usr_bob_auditor');
console.log('Exception approved by Bob! Status:', approved.status); // 'APPROVED'# Export RFC 4180 CSV report for compliance spreadsheets (Vanta, Drata, Excel):
curl -s -H "Authorization: Bearer am_live_..." \
"https://api.amaracus.tech/api/v1/compliance/reports/csv?frameworkId=SOC_2_TYPE_II" > soc2_audit_report.csv
# Export programmatic JSON report with SHA-256 integrity stamp:
curl -s -H "Authorization: Bearer am_live_..." \
"https://api.amaracus.tech/api/v1/compliance/reports/json?frameworkId=ISO_27001_2022" > iso27001_report.jsonEnd-to-End Developer Tutorial: Migration & OS Automation
A complete, runnable walkthrough using the official @amaracus/sdk. Follow these 6 steps to discover resources, evaluate health, create a post-quantum migration plan, simulate, approve, execute, and verify:
import { Amaracus } from '@amaracus/sdk';
async function main() {
// 1. Initialize Amaracus Client
const client = new Amaracus({
apiKey: process.env.AMARACUS_API_KEY!,
baseUrl: process.env.AMARACUS_BASE_URL || 'https://api.amaracus.tech/api/v1'
});
console.log('=== Step 1: Discover Unified Inventory ===');
const inventory = await client.os.getInventory({ verifiedOnly: true });
console.log(`Found ${inventory.length} cryptographic resources.`);
console.log('\n=== Step 2: Query Security Posture & Deduplicated Findings ===');
const posture = await client.os.getPosture();
console.log(`Overall Health Score: ${posture.score} / 100`);
console.log(`PQC Readiness: ${posture.pqcReadinessPercentage}%`);
for (const finding of posture.findings) {
console.log(` - [${finding.severity}] ${finding.title} (${finding.code})`);
}
console.log('\n=== Step 3: Create & Simulate Migration Plan ===');
const plan = await client.migrations.createPlan({
name: 'Transition Billing Keys to ML-KEM-768',
migrationType: 'PQC_TRANSITION',
sourceResourceId: 'key_billing_rsa_2048',
sourceAlgorithm: 'RSA-2048',
targetAlgorithm: 'ML-KEM-768',
proposerId: 'usr_alice_engineer',
environment: 'production'
});
console.log(`Created plan ${plan.id} in state: ${plan.state}`);
// Run non-destructive simulation
const simulation = await client.migrations.simulatePlan(plan.id);
console.log(`Simulation Safe: ${simulation.overallSafe}`);
console.log(`Rollback Feasible: ${simulation.rollbackFeasibility.isReversible}`);
console.log('\n=== Step 4: Multi-Party Approval (Four-Eyes Principle) ===');
// Proposer Alice cannot approve her own plan; Bob the CISO signs off
const approvedPlan = await client.migrations.approvePlan(plan.id, 'usr_bob_ciso');
console.log(`Plan approved by ${approvedPlan.approverId}. State: ${approvedPlan.state}`);
console.log('\n=== Step 5: Execute Migration with Zero Downtime ===');
const executed = await client.migrations.executePlan(plan.id, 'usr_bob_ciso');
console.log(`Migration completed! New active key pointer: ${executed.targetResourceId}`);
console.log(`Old key ${executed.sourceResourceId} status: RETIRED_FOR_ENCRYPTION (Historical reads preserved).`);
console.log('\n=== Step 6: Evaluate Continuous Automation Rules ===');
const automations = await client.os.evaluateAutomations();
console.log(`Evaluated ${automations.totalRules} rules across estate. Active watchdogs: ${automations.evaluations.length}`);
}
main().catch(console.error);// If any downstream client experiences an issue, trigger instant deterministic rollback:
const rollback = await client.migrations.rollbackPlan(
'plan_mig_12345',
'Downstream payment partner incompatible with multi-kilobyte lattice keys'
);
console.log('Rollback status:', rollback.state); // 'ROLLED_BACK'
console.log('Active key restored to original source key pointer.');Implementing with AI Assistants
System rules, prompt engineering templates, and anti-hallucination guardrails for Cursor, Claude Code, GitHub Copilot, ChatGPT, and Antigravity.
Why AI Needs Cryptographic Guardrails
AI models are notoriously prone to generating subtly insecure cryptographic code. They frequently suggest unauthenticated AES modes (ECB, CBC without HMAC), non-constant-time string comparisons that are vulnerable to timing attacks, or hardcode API secrets in client-side bundles.
By providing the AMARACUS system prompt and pointing the AI to our canonical endpoint https://api.amaracus.tech/api/v1, you instruct the AI to delegate cryptographic operations to the AMARACUS API instead of writing its own.
1. Project System Prompt (.cursorrules / CLAUDE.md)
Place in root of repositoryAdd these instructions to your project's .cursorrules, CLAUDE.md, or GitHub Copilot custom instructions:
# AMARACUS Cryptographic Integration Guardrails
When generating encryption, decryption, signing, or post-quantum key exchange in this codebase:
1. NEVER generate custom, local cryptographic algorithms, unauthenticated AES modes (ECB/CBC), or insecure random math.
2. Use the AMARACUS REST API (https://api.amaracus.tech/v1) or the @amaracus/sdk TypeScript client.
3. Keep the API key in process.env.AMARACUS_API_KEY. NEVER expose it to client-side bundles (e.g., no NEXT_PUBLIC_ prefixes).
4. Core endpoints:
- Encrypt with a managed key: POST /v1/encrypt { key, data } -> data.envelope
- Decrypt: POST /v1/decrypt { key, envelope } -> data.plaintext, data.encoding
- Hashing (SHA-2 / SHA-3 only): POST /v1/hash { algorithm, data }
- Post-Quantum KEM (ML-KEM-768): POST /v1/crypto/kem/keygen, /v1/crypto/kem/encapsulate, /v1/crypto/kem/decapsulate
- Security Posture & CBOM: GET /v1/os/posture & GET /v1/os/inventory
5. Passwords: AMARACUS does not hash passwords. Use Argon2id (or scrypt/bcrypt) locally; never SHA-256 alone.
6. Zero-out sensitive plaintext from memory after use and never log plaintext or keys.2. Master Prompts for AI Coding Assistants
Act as a Principal Security Architect. I need to implement field-level envelope encryption for sensitive user records (ssn, taxId, bankAccountNumber) in my Node.js/Next.js application using Prisma ORM.
Requirements:
1. Use the AMARACUS API at https://api.amaracus.tech/v1 with Bearer auth via process.env.AMARACUS_API_KEY and a managed key id in process.env.AMARACUS_KEY_ID.
2. For small fields, call POST /v1/encrypt with { key, data } and store the returned data.envelope string; decrypt with POST /v1/decrypt { key, envelope }.
3. For large payloads, use envelope encryption:
- Generate a random 32-byte data key locally (crypto.randomBytes) and encrypt the record with AES-256-GCM (Node crypto).
- Wrap the data key with POST /v1/encrypt { key, data: <base64 data key>, encoding: "base64" } and store the envelope.
- Erase the plaintext data key from memory.
- Store the ciphertext, IV, auth tag, and the wrapped data key envelope alongside the record.
4. Write a TypeScript service 'AmaracusCryptoService' with encryptField(plaintext) and decryptField(payload).
5. Provide a sample Prisma schema and a Next.js Server Action demonstrating how to save and retrieve an encrypted user profile.
6. Include robust error handling and ensure no decrypted data is ever logged.I am building an authentication service in TypeScript for my web app.
Requirements:
1. Passwords: hash locally with Argon2id using the argon2 npm package (memoryCost >= 19456, timeCost >= 2). AMARACUS does not provide password hashing; never send passwords to it and never use plain SHA-256 for passwords.
2. Login: verify with argon2.verify(storedHash, candidate), which is constant-time.
3. Sensitive profile fields (phone, date of birth): encrypt with the AMARACUS API at https://api.amaracus.tech/v1:
- POST /v1/encrypt with { "key": process.env.AMARACUS_KEY_ID, "data": "<value>" }; store data.envelope.
- POST /v1/decrypt with { "key": process.env.AMARACUS_KEY_ID, "envelope": "<stored envelope>" }; read data.plaintext.
4. Provide TypeScript code with input validation (zod) and proper error handling.Help me implement a Post-Quantum Cryptographic (PQC) message vault in TypeScript using NIST ML-KEM-768 via the AMARACUS API.
Requirements:
1. Use the AMARACUS API endpoints at https://api.amaracus.tech/v1:
- Generate Keypair: POST /v1/crypto/kem/keygen with { "algorithm": "ML-KEM-768" }
- Encapsulate: POST /v1/crypto/kem/encapsulate with { "algorithm": "ML-KEM-768", "publicKey": "<recipient_public_key>" }
- Decapsulate: POST /v1/crypto/kem/decapsulate with { "algorithm": "ML-KEM-768", "ciphertext": "<encapsulation_ciphertext>", "privateKey": "<recipient_private_key>" }
2. Implement a hybrid envelope workflow:
- Sender encapsulates a shared secret using recipient's ML-KEM-768 public key.
- Sender encrypts the sensitive file using AES-256-GCM keyed by the shared secret.
- Recipient decapsulates the shared secret using their private key and decrypts the file.
3. Provide clean TypeScript functions with typed request and response interfaces.Write a robust webhook receiver middleware in Node.js (Express or Next.js App Router route handler) to verify incoming AMARACUS webhook signatures.
Requirements:
1. AMARACUS sends a signature in the header: X-Amaracus-Signature: t=<timestamp>,v1=<hmac_sha256_hex>.
2. The middleware must:
- Extract the raw request body buffer (do not parse JSON before calculating HMAC).
- Recreate the signed payload: ${timestamp}.${rawBody}.
- Compute HMAC-SHA256 using crypto.createHmac('sha256', process.env.AMARACUS_WEBHOOK_SECRET).
- Compare the computed digest with the received v1 signature using crypto.timingSafeEqual to avoid timing attacks.
- Reject requests where the timestamp is older than 5 minutes (replay attack protection).
3. Return HTTP 400 or 401 if verification fails, and proceed to handler if verified.AI Code Review & Safety Checklist
| Checklist Item | Safe AI Pattern | Reject / Flag Prompt |
|---|---|---|
| API Keys | Server-side env process.env.AMARACUS_API_KEY | NEXT_PUBLIC_AMARACUS_API_KEY |
| Cipher Mode | Authenticated AEAD (AES-256-GCM / ChaCha20-Poly1305) | AES-ECB or CBC without HMAC |
| Signatures | crypto.timingSafeEqual() | String comparison '===' |
| Key Erasure | Plaintext data keys zeroed from memory immediately | Retaining plaintext in global memory |
| Endpoint | https://api.amaracus.tech/api/v1 | Hallucinated local crypto endpoints |
3. Live Verification Commands
Test the endpoints in your terminal to verify responses against what your AI generated:
# 1. Check your API key works (lists the keys it can see)
curl https://api.amaracus.tech/v1/keys \
-H "Authorization: Bearer $AMARACUS_API_KEY"
# 2. Encrypt with one of your managed keys
curl -X POST https://api.amaracus.tech/v1/encrypt \
-H "Authorization: Bearer $AMARACUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"key":"'"$AMARACUS_KEY_ID"'","data":"Sensitive payload test"}'