Behavioral session key revocation · Kite Agent Passport

AI agents,behaviorally registered

60ssession key expiry window
2σanomaly detection threshold
100%gate decisions on-chain
Problem

Amount
≠ behavior.

Static spending limits only ask how much? — they never ask whether this still looks like the same agent. Three attack patterns exploit this gap entirely.

01

Limit-aware draining

Attacker compromises an agent and fires 9 transactions just under the per-transaction cap to different unknown addresses. Every single one passes. Funds leave. Static limits never notice.

9×transactions, all approved
How it works

Register.Gate.Freeze.

Stack

Every layer
on-chain.

Four components. Each with a single job. The entire lifecycle of an agent — registration, baseline commitment, gate decisions, freezes — is visible on the Kite block explorer with no external dependencies.

3contracts

All deployed on Kite AI testnet. All indexed by Goldsky.

200tx → corr_dim mode
5sGoldsky poll interval
Kite L1 Testnet
AgentRegistry.solOn-chain identity and state layer. Stores agentId, baseline hash, and status. Emits AgentRegistered, BaselineCommitted, AgentFrozen events.
GraphQL · public
Goldsky SubgraphIndexes all events from all three contracts in real time. Provides agent history, gate decisions, and baseline commits via GraphQL.
nolds · Flask
Python MicroserviceStateless math service. Runs nolds.sampen() for early-stage agents (<200 tx) and nolds.corr_dim() for mature agents (≥200 tx).
gokite-aa-sdk
Session Key GateAfter STABLE verdict: addSessionKeyRule() issues a 60s session key. After DIVERGED: freezeAgent() fires on-chain. No key issued.
LIVE

Behavioral
by the numbers.

0+
Transactions seeded per demo agent
normal behavioral baseline
last N computed metrics
Baseline rolling window
0
standard deviations from mean
Anomaly detection threshold
±0σ
Takens (1981) — delay embeddingGrassberger-Procaccia (1983) — correlation dimensionSample entropy — early-stage agentsCorrelation dimension — mature agents
Full stack

Built on
real tools.

Every component is a real integration — no mock data, no simulated events. Gate decisions, freezes, and baseline commits all happen on Kite L1.

Identity · DIDKite Agent Passport

Official Kite DID system. Every agent gets a Passport (did:kite:user/agent/name-v1) — the cryptographic anchor of agent identity. Registration is automatic.

L1 TestnetKite AI

Base chain. Agent registry, gate decisions, and freeze events all live here. Bundler RPC and gasless transactions for session keys.

Short-lived authSession Keys

60-second keys issued on STABLE verdicts. Refusing to renew is a cryptographic freeze — no override possible without human review.

IndexingGoldsky

Real-time subgraph over Kite. Powers the payment history, gate decisions, and audit trail you see on every page.

Payment Protocolx402

Signed payment intents (EIP-3009). Agent signs, gate validates, then the payment is forwarded — never the other way around.

Behavioral analysisChaos-theory math

Sample entropy for early-stage agents, correlation dimension for mature agents. Switches automatically once enough history exists.

Tamper-evident baselineOn-chain anchor

Behavioral baseline is hashed and committed on-chain. Quietly raising the threshold is impossible without leaving a permanent record.

ContractsHardhat

Solidity compilation and deployment to kite-ai-testnet. ABIs generated for backend and subgraph.

WalletPrivy AA

Smart contract account on Kite testnet. Funds live here. Session keys delegate spend authority.

DatabaseMongoDB

Stores agent baseline history, rolling mean/stddev, mode (early/mature), and gate decision log.

FrontendReact Query

Polls Goldsky every 5–10s. Powers dashboard feed, agent detail charts, live metric updates.

ChartsRecharts

Behavioral metric chart and transaction amount chart on agent detail page. Threshold lines overlaid.

FrontendNext.js

App router. API routes proxy to backend — frontend never exposes backend URL to the browser.

3Smart contracts
1Subgraph
100%On-chain audit trail
View full architecture→
Math

Phase space,
not thresholds.

Every agent's transaction history is a time series. KiteGarden maps it into phase space and measures the geometric complexity of its behavioral attractor. Shape shift = anomaly.

Current mode
corr_dim≥200 transactions — mature agent
SampEnD₂RANSAC fittamper-evident
01

Delay embedding

Transaction amounts form a scalar time series. Takens' theorem reconstructs the full attractor geometry in m-dimensional phase space using time delays.

02

Correlation dimension D₂

Grassberger-Procaccia algorithm computes the slope of log C(r) vs log r. Stable agents produce consistent D₂ ∈ [1.5, 3.5]. Compromised agents shift.

03

Sample entropy (early-stage)

For <200 transactions, SampEn measures payment rhythm irregularity. A sudden spike means the agent's behavior has become unexpectedly unpredictable.

04

On-chain baseline hash

The baseline parameters are hashed and committed on-chain, anchored to the agent's Kite Passport DID. Any quiet alteration produces a new transaction — visible, timestamped, permanent.

Gate API

One endpoint.
Every payment.

Every AI agent with payment authority calls POST /api/gate before submitting any payment. The gate runs behavioral analysis and returns a verdict in under 500ms.

01

x402 payload validation

EIP-712 signature recovery, validBefore check, from-address match — all before behavioral analysis runs.

02

Two-mode analysis

Automatic mode switch at 200 transactions. SampEn for early-stage, corr_dim with RANSAC for mature.

03

On-chain audit log

Every gate decision — issue, deny, freeze, re-authorize — is anchored to the agent's Kite Passport DID and indexed in real time.

04

60-second session keys

Refusing to renew equals a cryptographic freeze. No key, no payment. No override without human review.

gate-request.json

Ready to protect
your AI agents?

Register an agent on Kite testnet. Its behavioral baseline is committed on-chain. The gate runs on every payment. Any shape shift triggers a cryptographic freeze.

Built on Kite L1 testnet · Goldsky · x402 · nolds