You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
***TECHOPS-19100:** fix ci ([#10](https://github.com/circlefin/circle-ooak/issues/10)) ([552bde8](https://github.com/circlefin/circle-ooak/commit/552bde8416413efe214eb20562e55d70a3fbe1a9))
32
35
***TECHOPS-19100:** switch to public worfklow tokens ([#11](https://github.com/circlefin/circle-ooak/issues/11)) ([d0ac119](https://github.com/circlefin/circle-ooak/commit/d0ac119acd17584b1cac9c0f58e08c524be01385))
33
36
34
-
## 0.2.0 (2026-06-30)
35
-
This API breaking change closes a security vulnerability by adding intent verification during execution.
36
-
37
-
***API breaking change** Tools no longer need to take `wfid` as an argument.
38
-
***Security fix** Fixed vulnerability that allowed LLM to mix-and-match `wfid` and `intent`. This is now checked and enforced by OOAK framework.
39
-
***Tool failure support** The SecurityContext can supply an optional `on_invoke_tool_failure` hook that runs when a tool raises an exception.
40
-
***Added `bind_to_instance` on `InstanceAgent`** — optional runtime object id for instance identity to avoid name collisions across agents.
Copy file name to clipboardExpand all lines: README.md
+17-15Lines changed: 17 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,26 +13,27 @@ This project creates an extension to the OpenAI Agents SDK.
13
13
14
14
- The `@agent_tool` decorator can be used with object instance methods instead of `@function_tool` which only
15
15
supports static functions.
16
-
- The `@secure_tool` decorator can be used instead of the `@agent_tool` decorator
16
+
- The `@secure_tool` decorator can be used instead of the `@agent_tool` decorator
17
17
to add before/after hooks to your tool code.
18
-
- An `InstanceAgent` that can use `@agent_tool` and `@secure_tool`. An `InstanceAgent` is a subclass of
18
+
- An `InstanceAgent`subclass that can use `@agent_tool` and `@secure_tool`. An `InstanceAgent` is a subclass of
19
19
a regular OpenAI Agents SDK `Agent` and can interact with other agents via handoffs and guardrails.
20
20
21
21
22
22
This package includes a `WorkflowManager` that implements the abstract `SecureContext`,
23
23
that checks that intended actions have been approved.
24
24
25
25
1. Create intent. The agent calls the @secure_tool function with `wfid=None` argument. Instead of
26
-
executing the function, it returns an intent: a json representation of the function call.
27
-
2. Get Approval. The agent calls the WorkflowManager with a list of intents. The manager invokes `get_approval()` (which you override to connect your UX or policy) and, if approved, returns a WorkflowId.
28
-
3. Execute. The agent now calls the @secure_tools in the correct order with the WorkflowId. The
26
+
executing the function, it returns an intent: a JSON representation of the function call.
27
+
2. Get approval. The agent calls the WorkflowManager with a list of intents. The manager invokes `get_approval()` (which you override to connect your UX or policy) and, if approved, returns a `wfid`.
28
+
3. Execute. The agent now calls the @secure_tools in the correct order with the `wfid`. The
29
29
WorkflowManager ensures that each subsequent function call matches the approved workflow.
30
30
31
-
Sample code can be found at `https://github.com/circlefin/circle-ooak/example`
31
+
Sample code can be found at https://github.com/circlefin/circle-ooak/tree/master/example
32
32
33
33
Below is an example of a `WalletWorkflowAgent`.
34
34
35
35
```python
36
+
from agents import function_tool, RunContextWrapper, OpenAIChatCompletionsModel
36
37
from circle_ooak.instance_agent import InstanceAgent
37
38
from circle_ooak.secure_tool import secure_tool
38
39
from circle_ooak.workflow_manager import WorkflowManager
@@ -41,11 +42,11 @@ class WalletWorkflowAgent(InstanceAgent):
41
42
instructions ="""
42
43
You help users execute Ethereum transactions. Do the following steps to help the user:
43
44
1. Create a workflow of intents by calling each secure tool with wfid=None to get the intents
44
-
2. Call approve_workflow with the list of intents to get a workflow id
45
-
3. Execute the workflow by calling each secure tool again. You MUST include the wfid parameter with the workflow id you got in step 2.
45
+
2. Call approve_workflow with the list of intents to get a wfid
46
+
3. Execute the workflow by calling each secure tool again. You MUST include the wfid parameter with the wfid you got in step 2.
46
47
4. Print the final tx hash for every transaction.
47
48
48
-
You do not need approval from the user to execute a workflow if you have the workflow id.
49
+
You do not need approval from the user to execute a workflow if you have the wfid.
@@ -131,7 +132,7 @@ Install the `circle-ooak` package and other dependencies:
131
132
132
133
```shell
133
134
pip install circle-ooak
134
-
pip install dotenv openai openai-agents
135
+
pip install python-dotenv openai openai-agents
135
136
```
136
137
137
138
Alternatively, you can clone the GitHub Repo and install using
@@ -151,7 +152,7 @@ python -m venv .venv
151
152
# activate the environment
152
153
source .venv/bin/activate
153
154
154
-
#de-activate the environment
155
+
#deactivate the environment
155
156
deactivate
156
157
```
157
158
@@ -163,7 +164,7 @@ Create an `.env` file. You must obtain an OpenAI API key.
163
164
OPENAI_API_KEY=api_key_goes_here
164
165
165
166
# URL to connect to OpenAI
166
-
OPENAI_URL=https://api.openai.com/v1/models
167
+
OPENAI_URL=https://api.openai.com/v1
167
168
168
169
# OpenAI model to use
169
170
OPENAI_MODEL=gpt-4o
@@ -177,6 +178,7 @@ You must setup your LLM using the `.env` file to run the demo.
177
178
git clone http://github.com/circlefin/circle-ooak
178
179
cd circle-ooak
179
180
pip install -r requirements.txt
181
+
pip install circle-ooak
180
182
181
183
# To run a Wallet Workflow Agent
182
184
python example/run_agent.py
@@ -238,7 +240,7 @@ Each `@secure_tool` execution with a `wfid` uses three hooks:
238
240
### Instance identity in intents
239
241
OOAK needs a way to uniquely identify agents for approval. There are two choices:
240
242
-**by name**. When an `InstanceAgent` is initialized with `bind_to_instance=False`, then OOAK identifies the agent using the `name` supplied during object creation. This creates a stable name across restarts.
241
-
-**by object reference**. When an `InstanceAgent` is initialized with `bind_to_instance=True`, then OOAK identifies the agent
243
+
-**by object reference**. When an `InstanceAgent` is initialized with `bind_to_instance=True`, then OOAK identifies the agent
242
244
using the run-time object identifier. This prevents any naming collisions. Agents have new ids after every restart.
0 commit comments