Overview
The OpenAI integration has two practical paths:- Python adapter — use the built-in CAW OpenAI adapter
- TypeScript custom tools — wrap the CAW TypeScript SDK in OpenAI Agents SDK tool definitions
build_function_tools()— raw function toolsget_cobo_tools()— bring-your-own agentcreate_cobo_agent()— preconfigured agent with denial-aware guidance
Quick Start
Tool Selection
To restrict the CAW tools exposed to the agent, passinclude_tools or exclude_tools:
get_cobo_tools(client, include_tools=[...]).
TypeScript Path
When using the OpenAI Agents SDK in TypeScript, use@cobo/agentic-wallet as the backend and expose CAW operations through a small set of custom tools. Keep the same role-based split used elsewhere in the docs:
- Pact Drafting:
submitPact,getPact - Execution:
transferTokens,contractCall, fee estimation - Observer: transaction record lookup and audit logs
create_cobo_agent(). The recommended pattern is to keep CAW inside your own tool functions so you control tool naming, retry logic, and the exact surface exposed to the model.
Three Levels of Integration
Function Tools
build_function_tools() returns raw function tools for maximum flexibility.Tool Set
get_cobo_tools() returns tools ready for any OpenAI agent.Full Agent
create_cobo_agent() returns a preconfigured agent with denial-aware system prompt.Denial Behavior
Policy denials are preserved as structured guidance and fed back into subsequent agent instructions for retry decisions.How denial feedback works
How denial feedback works
When a tool returns a policy denial, the OpenAI agent receives the structured
denial (code, reason, details, suggestion) in its context. The agent’s system
prompt instructs it to parse this feedback and retry with compliant parameters.
Source Code
src/cobo_agentic_wallet/integrations/openai/agent.py