Before you start
Complete the CLI quickstart first so your runtime already has a paired wallet, API key, and wallet UUID.5-minute outcome
- Create Cobo-enabled OpenAI agent
- Submit a pact and wait for owner approval
- Execute success plus denial contract-call sequence
- Let agent adapt using denial context
- Track by
request_idand verify with audit logs
Step 1: Install
- Python
- TypeScript
Step 2: Configure environment
Step 3: Run agent flow
- Python
- TypeScript
openai_quickstart.py
Step 4: Validate results
Confirm final output includes:- pact submission and activation confirmation
- success event
- denial reason and suggestion
- successful compliant retry
- transaction lookup by
request_id - audit confirmation
Keep the OpenAI layer thin
The OpenAI agent should coordinate the CAW flow, not absorb every wallet capability by default.- expose only the tools needed for the runtime role
- keep pact submission and execution close together so the approval story stays legible
- prefer durable tracking by
request_id - move deterministic checks outside the agent loop when you need strict control
Go further
In Python,create_cobo_agent wires up the widened CAW runtime toolkit directly. In TypeScript, the normal pattern is to wrap the CAW TypeScript SDK in OpenAI tool functions and expose only the subset your runtime needs.
- Define custom function tools — in Python, add functions alongside CAW’s built-in adapter; in TypeScript, wrap
@cobo/agentic-walletAPI calls in framework-native tool definitions. - Keep CAW behind a narrow tool surface — do not expose the whole API to the model. Start with Pact Drafting, Execution, and Observer roles.
- Use direct SDK calls for out-of-band operations — run pact submission, policy dry-runs, and audit queries programmatically outside the agent loop when you need deterministic behavior.
- Combine with CLI — use
cawfor onboarding and debugging; use the SDK tools for agent-time execution. - Use role-based presets — start with Pact Drafting, Execution, and Observer responsibilities instead of exposing the entire toolkit immediately.
OpenAI Integration Details
Context handling and denial behavior.
Python SDK
Use WalletAPIClient directly for custom tool functions.