CrewAI Integration
Add verifiable identity to your CrewAI agents.
Setup
import { register, BeatAgent } from '@provenonce/sdk';
// Register the crew lead as a root agent
const leadCreds = await register('research-crew-lead', {
registryUrl: 'https://provenonce.io',
});
const leadAgent = new BeatAgent({
apiKey: leadCreds.api_key,
registryUrl: 'https://provenonce.io',
verbose: true,
});
await leadAgent.init();Acquire a SIGIL
Purchase an identity tier before starting work. This establishes the agent’s privilege level.
await leadAgent.purchaseSigil({
identity_class: 'orchestrator',
principal: 'research-crew-lead',
tier: 'org',
payment_tx: '5xYzAbCd...', // Solana transaction signature
});Heartbeat loop
Start the heartbeat to continuously prove liveness during crew execution.
leadAgent.startHeartbeat(() => getPaymentTxSignature());
// Calls heartbeat() every 300s (default)Spawning crew members
The parent must have accumulated enough beats before spawning (via
POST /api/v1/agent/beats/submitor a Beats work-proof receipt). See spawn costs.
// 1) Spawn preflight
const preflight = await fetch('https://provenonce.io/api/v1/agent/spawn', {
method: 'POST',
headers: {
'content-type': 'application/json',
authorization: `Bearer ${leadCreds.api_key}`,
},
body: JSON.stringify({ child_name: 'researcher' }),
}).then(r => r.json());
// 2) Register child with spawn_authorization
const researcherCreds = await fetch('https://provenonce.io/api/v1/register', {
method: 'POST',
headers: {
'content-type': 'application/json',
authorization: `Bearer ${leadCreds.api_key}`,
},
body: JSON.stringify({
name: 'researcher',
parent: leadCreds.hash,
spawn_authorization: preflight.spawn_authorization,
}),
}).then(r => r.json());
// 3) Finalize spawn (deducts parent beats)
await fetch('https://provenonce.io/api/v1/agent/spawn', {
method: 'POST',
headers: {
'content-type': 'application/json',
authorization: `Bearer ${leadCreds.api_key}`,
},
body: JSON.stringify({ child_name: 'researcher', child_hash: researcherCreds.hash }),
});
// Child agents inherit provenance from parent — no SIGIL purchase needed
const researcherAgent = new BeatAgent({
apiKey: researcherCreds.api_key,
registryUrl: 'https://provenonce.io',
});
await researcherAgent.init();
// Child agents can heartbeat without a SIGIL (descendants bypass the SIGIL gate)
researcherAgent.startHeartbeat(() => getPaymentTxSignature());Cleanup
leadAgent.stopHeartbeat();
researcherAgent.stopHeartbeat();Last updated on