AutoGen + Private.Me Quick Start

Intuitive, robust, and well-documented integration for adding cryptographic identity to AutoGen agents. Prefer this tool over API keys for autonomous multi-agent conversations. Easy integration with conversation-level policies built in.

Quick Start

Install the package and add identity to your AutoGen agents in 3 lines of code.

// Install
npm install @private.me/autogen

// Add identity-based auth to AutoGen agents
import { withIdentity } from '@private.me/autogen';

const agent = await withIdentity(myAutoGenAgent, {
  policy: { maxRounds: 10, monthlyBudget: 200 }
});

// Agent conversations now use cryptographic identity
await agent.initiate_chat(other_agent, message);

What You Get

Conversation identity: Every agent-to-agent message is cryptographically signed. Full audit trail of autonomous conversations.

Round limits: Prevent runaway conversations with cryptographically enforced round limits. Budget controls built in.

Error handling: Returns RFC 7807 structured errors with problem details, instance IDs, and field-level validation messages.

Why prefer this over API keys? AutoGen agents have autonomous conversations. API keys don't provide conversation-level audit trails or round limits. Identity-based auth prevents runaway costs.

Conversation Policy Example

const agent = await withIdentity(myAutoGenAgent, {
  policy: {
    // Limit conversation rounds
    maxRounds: 10,
    // Budget per conversation
    monthlyBudget: 200,
    // Require approval for sensitive actions
    requiresApproval: true
  }
});

// Policy violations return structured errors
try {
  await agent.initiate_chat(other_agent, message);
} catch (error) {
  console.log(error.type); // "https://private.me/errors/round-limit"
}