ailo.life
v1.0.0
Published
Ailo Verify SDK — add verifiable AI outputs to your agent
Readme
ailo.life
Add verifiable AI outputs to your agent. Every call gets a tamper-proof verify code; recipients can verify at ailo.life/verify.
Install
npm install ailo.lifeSetup
// .env
AILO_VERIFY_API_KEY=sk_xxx
// agent.ts
import { Verify } from 'ailo.life';
const verify = Verify.init();Usage
Single-turn
export async function handleQuery(query: string) {
const { result, verifyCode } = await verify.trace('support', async (trace) => {
const response = await openai.chat.completions.create({ ... });
trace.llmCall({ model: 'gpt-4o', promptTokens: 150, completionTokens: 80 });
trace.toolCall('send_email', { to: '[email protected]' });
return response.choices[0].message.content;
});
return result + '\n\n' + verify.embed(verifyCode);
}Multi-turn (conversationId)
export async function handleTurn(conversationId: string, message: string) {
const { result, verifyCode } = await verify.trace('support', { conversationId }, async (trace) => {
// ... LLM + tool calls
return response;
});
return result + '\n\n' + verify.embed(verifyCode);
}With customerId (optional)
const { result, verifyCode, sessionHash } = await verify.trace('support', {
conversationId: 'conv_abc',
customerId: 'cust_123',
}, async (trace) => { ... });Verification
- Each call: Has its own
verifyCode(e.g.100X2K9MPN). Verify at ailo.life/verify?code=... - Privacy: Verify page shows only the verified event (not the full chain). Chain integrity is attested server-side.
sessionHashfor programmatic checks.
Testing & Publishing
Testing locally
Dry-run mode — Use
Verify.init({ dryRun: true })to skip API calls in tests:const verify = Verify.init({ dryRun: true }); const { result, verifyCode } = await verify.trace('test', async (trace) => { trace.llmCall({ model: 'gpt-4o', promptTokens: 10, completionTokens: 5 }); return 'ok'; }); // verifyCode will be mock value like "100DRY0000"Link locally — From the monorepo root:
cd packages/verify && npm link. In your test app:npm link ailo.life.Run build —
cd packages/verify && npm run build(runstsc).
Publishing to npm
- Login:
npm login(create account at npmjs.com if needed). - Version: Bump in
package.jsonor runnpm version patch|minor|major. - Publish:
cd packages/verify && npm publish. For scoped packages, first publish:npm publish --access public. - Verify:
npm view ailo.lifeto confirm the package is live.
