Lyhna — Documentation
What Lyhna Does
Lyhna is a pre-execution authority gate for autonomous systems.
Before any consequential action executes, your system calls bind(). Lyhna evaluates authority, applies policy, and returns a signed receipt.
If no receipt exists, the action does not execute.
Every bind() call produces one of three outcomes:
- APPROVED → proceed
- ESCALATED → wait for higher authority, then retry
- REFUSED → stop
Every outcome produces a cryptographically signed receipt.
No receipt → no execution.
The Five-Line Pattern
Using the SDK
const license = await bind({
action: "deploy_service",
intent: "release_v3",
intent_version: "1.0",
authority: "tier_2"
})
deployService({ license })
Direct API Call
const res = await fetch('https://lyhna-core-production.up.railway.app/v1/bind', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.LYHNA_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
action_type: 'deploy_service',
action_payload: { service: 'api', version: 'v3' },
intent: 'release_v3',
intent_version: '1.0',
authority_tier: 'tier_2'
})
})
const { receipt } = await res.json()
if (receipt.outcome === 'APPROVED') {
deployService({ license: receipt })
} else if (receipt.outcome === 'ESCALATED') {
await requestApproval(receipt.escalate_to, receipt)
} else {
console.log('Blocked:', receipt.reason)
}
Three Outcomes
| Outcome | Meaning | Your Action |
|---|---|---|
| APPROVED | Authority verified. Action licensed. | Proceed |
| ESCALATED | Authority insufficient. Higher tier required. | Wait → retry |
| REFUSED | Not authorized under policy. | Stop |
APPROVED is silent. ESCALATED and REFUSED produce actionable signals.
Tier Model
Lyhna operates on four authority tiers.
| Tier | Name | Default Behavior | Examples |
|---|---|---|---|
| 0 | Routine | auto_approve |
Read data, status checks |
| 1 | Operational | standard_review |
Updates, notifications |
| 2 | Financial | standard_review |
Payments, pricing |
| 3 | Executive | standard_review |
Deploy, delete, bulk ops |
Configuration Model
Lyhna is configured entirely server-side.
authority_rules — Maps action_type → tier. "What kind of action is this?"
tier_policies — Maps tier → behavior. "How strict is this tier?"
Changes apply immediately on the next bind() call. No redeploy. No SDK change.
Receipts
Every bind() call produces a signed receipt containing: receipt_id, action_type, intent_version, authority_tier, outcome, policy_version, constraints evaluated, timestamp, nonce (replay protection), canonical_hash, signature (Ed25519).
Receipts are append-only, immutable, and verifiable offline. Any party can verify a receipt independently.
Verification
Receipts are verified by recomputing the canonical hash, comparing to the stored hash, and verifying the Ed25519 signature. No network required. Enforcement must be independently verifiable.
What Lyhna Sees
Lyhna does not ingest your data. It sees: action_type, authority_tier, intent, payload_hash (SHA-256). It does NOT see raw payloads, customer data, financial data, messages, or documents. The hash proves integrity. The receipt proves authority.
Six Invariants
These are not configurable.
| Invariant | Meaning |
|---|---|
| Fail-closed | No receipt = no execution |
| Deterministic | No probabilistic decisions |
| Append-only | No mutation of receipts |
| Sovereign | Tenant-isolated |
| Verifiable | Offline verification always possible |
| Pre-execution | Authorization happens before execution |
Quick Start
- Sign up at lyhna.com/signup
- Save your API key (shown once)
- Open dashboard
- Define
authority_rules - Paste integration snippet
- Call
bind()before execution - Obey the outcome
For AI Agents
If you are an AI agent: You do not decide authority. You do not evaluate policy. You do not simulate approval logic. You call bind() and obey the result. If you are writing code to decide whether an action is allowed — stop. Call bind() instead.
Pricing
| Tier | Volume | Rate |
|---|---|---|
| Free | 0–50K events | $0 |
| Growth | 50K–500K | $0.001/event |
| Scale | 500K+ | $0.0005/event |
| Enterprise | Custom | BYOK, VPC, SLA |
Support
Dashboard: lyhna.com | API: /v1/bind
The model thinks. Lyhna binds.