🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

kxco-pq-agent

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kxco-pq-agent

Post-quantum identity for AI agents and autonomous systems — a KYC-verified institution sponsors an ML-DSA-65 keypair and locked capability scope for any agent that cannot pass KYC itself.

latest
Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
150
1566.67%
Maintainers
1
Weekly downloads
 
Created
Source

kxco-pq-agent

Post-quantum identity for AI agents and autonomous systems.

The problem it solves

AI systems cannot pass KYC. An LLM, robot, IoT device, or daemon has no legal standing to authenticate itself to a regulated network. This package solves that with a delegation model: a KYC-verified institution sponsors the agent by signing its ML-DSA-65 public key alongside a locked capability scope. The agent then signs its own relay operations independently, presenting the sponsor's credential as proof of authority. The KXCO relay validates both signatures before accepting any intent — the institution's approval is cryptographically bound to every action the agent takes.

When to use this

Use this package when deploying LLMs, robots, IoT devices, or daemons that need to perform on-chain operations — payments, attestation anchoring, audit checkpointing — with verifiable, auditable scope controlled by a licensed institution.

Install

npm install kxco-pq-agent

Quick start

import { KxcoAgentIdentity } from 'kxco-pq-agent'

// sponsor is a KxcoIdentity from kxco-pq-sdk
// it must have .kid (string) and .sign(Uint8Array) -> Promise<Uint8Array>

const agent = await KxcoAgentIdentity.create({
  sponsor,
  label:     'Settlement Bot',
  agentType: 'llm',
  scope: {
    attestations: { purposes: ['trade-confirmation'] },
    auditLog: true,
  },
  expiresIn: '90d',
})

// Connect to the relay and anchor an attestation
const client = agent.toChainClient('https://relay.kxco.ai')

const result = await client.anchorAttestation({
  payloadHash: '9f86d081884c7d65...',
  purpose:     'trade-confirmation',
})
// { txHash: '0x...', blockNumber: 228345 }

Scope manifest

The scope is signed by the sponsor at issuance and cannot be changed. To update an agent's permissions, revoke and re-issue.

scope: {
  payments: {
    maxPerTransaction: 5000,       // maximum ARMR per transfer (positive number)
    maxPerDay:         50000,      // rolling daily cap across all transfers
    allowedRecipients: [           // EVM address (0x + 40 hex) or KXCO kid (16 hex chars)
      '0xAbCdEf...',
      'aa29f37ab7f4b2cf',
    ],
  },
  attestations: {
    purposes: ['trade-confirmation', 'settlement-receipt'],  // allowed purpose strings
  },
  auditLog:    true,   // permits anchorAuditRoot calls
  credentials: false,  // permits credential management (use sparingly)
}

All fields are optional. Omit a section entirely to deny that capability. The scope hash (SHA-256 of the JCS-canonical scope JSON) is stored on-chain at issuance so the relay can verify integrity.

API

KxcoAgentIdentity

KxcoAgentIdentity.create(opts)Promise<KxcoAgentIdentity>

Generates an ML-DSA-65 keypair for the agent and has the sponsor sign the credential.

OptionTypeRequiredDescription
sponsor{ kid: string, sign(msg: Uint8Array): Promise<Uint8Array> }YesThe sponsoring KxcoIdentity
labelstringYesHuman-readable name for this agent
agentType'llm' | 'robot' | 'iot' | 'process'YesCategory of the agent
modelstringNoModel, firmware, or version identifier
scopeobjectYesCapability manifest (see above)
expiresInstring | numberYesDuration: '30d', '1y', or seconds as a number
chainKxcoChainNoIf provided, registers the credential on-chain at issuance

agent.toChainClient(relay, opts?)AgentChainClient

Returns a relay client that automatically attaches the agent's credential and signature to every request.

OptionTypeDefaultDescription
relaystringRelay base URL, e.g. 'https://relay.kxco.ai'
opts.timeoutnumber10000Request timeout in milliseconds

agent.sign(message)Promise<Uint8Array>

Signs an arbitrary message with the agent's ML-DSA-65 private key.

agent.export()object

Serialises the full identity including the secret key. Store securely.

KxcoAgentIdentity.import(exported)Promise<KxcoAgentIdentity>

Restores an agent identity from a previously exported object.

KxcoAgentIdentity.verify(credential, opts?)Promise<{ valid, agentKid, sponsorKid, scope, ... }>

Verifies an agent credential envelope.

  • Without opts.sponsorPublicKey: checks format and expiry only.
  • With opts.sponsorPublicKey (Uint8Array): performs full ML-DSA-65 signature verification.

KxcoAgentIdentity.revoke(agentKid, { chain, reason? })Promise

Revokes an agent credential on-chain. chain must be a KxcoChain instance belonging to the original sponsor.

AgentChainClient

Returned by agent.toChainClient(). All methods return Promise<{ txHash: string, blockNumber: number }>.

client.anchorAttestation({ payloadHash, purpose })

Anchors an attestation envelope hash on-chain. Requires scope.attestations with the matching purpose listed.

client.anchorAuditRoot({ rootHash, entryCount })

Anchors an audit log checkpoint on-chain. Requires scope.auditLog: true.

client.transfer({ to, amount })

Submits a payment intent. to is an EVM address or KXCO kid. amount is in ARMR. The relay enforces allowedRecipients, maxPerTransaction, and maxPerDay from the scope.

Agent types

TypeUse
llmLarge language models and AI assistants
robotPhysical robots and automated machinery
iotIoT devices and sensors
processAutomated software processes and daemons

What this does NOT do

  • Agents cannot issue credentials to other agents. Only a KYC-verified sponsor can create an agent identity.
  • Agents cannot exceed the scope declared at issuance. The relay enforces scope server-side; attempting an out-of-scope operation returns an error.
  • Agents cannot operate without a sponsor. There is no anonymous or self-signed credential mode.

Part of the KXCO stack

PackagePurpose
kxco-post-quantumML-DSA-65 and ML-KEM primitives
kxco-pq-sdkKxcoIdentity — human and institution identities
kxco-pq-agentThis package — machine and agent identities

Contact: hello@kxco.ai | https://kxco.ai

Authors

Shayne Heffernan and John Heffernan — KXCO by Knightsbridge

Keywords

post-quantum

FAQs

Package last updated on 22 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts