daai-console 0.1.0a2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. daai_console-0.1.0a2/LICENSE +17 -0
  2. daai_console-0.1.0a2/MANIFEST.in +7 -0
  3. daai_console-0.1.0a2/PKG-INFO +241 -0
  4. daai_console-0.1.0a2/README.md +212 -0
  5. daai_console-0.1.0a2/docs/agency-adoption-prompt.md +69 -0
  6. daai_console-0.1.0a2/docs/alpha-test-checklist.md +81 -0
  7. daai_console-0.1.0a2/docs/known-limitations.md +14 -0
  8. daai_console-0.1.0a2/docs/security-model.md +50 -0
  9. daai_console-0.1.0a2/docs/staging-alpha-guide.md +31 -0
  10. daai_console-0.1.0a2/examples/finance_admin_basic.py +21 -0
  11. daai_console-0.1.0a2/examples/finance_admin_worker.py +25 -0
  12. daai_console-0.1.0a2/examples/live_client_smoke.py +150 -0
  13. daai_console-0.1.0a2/examples/live_runtime_smoke.py +239 -0
  14. daai_console-0.1.0a2/examples/staging_alpha_test.py +129 -0
  15. daai_console-0.1.0a2/pyproject.toml +55 -0
  16. daai_console-0.1.0a2/setup.cfg +4 -0
  17. daai_console-0.1.0a2/src/daai_console/__init__.py +44 -0
  18. daai_console-0.1.0a2/src/daai_console/client.py +237 -0
  19. daai_console-0.1.0a2/src/daai_console/exceptions.py +36 -0
  20. daai_console-0.1.0a2/src/daai_console/py.typed +0 -0
  21. daai_console-0.1.0a2/src/daai_console/runtime/__init__.py +8 -0
  22. daai_console-0.1.0a2/src/daai_console/runtime/manager.py +53 -0
  23. daai_console-0.1.0a2/src/daai_console/runtime/runner.py +80 -0
  24. daai_console-0.1.0a2/src/daai_console/store/__init__.py +8 -0
  25. daai_console-0.1.0a2/src/daai_console/store/pending.py +138 -0
  26. daai_console-0.1.0a2/src/daai_console/types.py +79 -0
  27. daai_console-0.1.0a2/src/daai_console.egg-info/PKG-INFO +241 -0
  28. daai_console-0.1.0a2/src/daai_console.egg-info/SOURCES.txt +31 -0
  29. daai_console-0.1.0a2/src/daai_console.egg-info/dependency_links.txt +1 -0
  30. daai_console-0.1.0a2/src/daai_console.egg-info/requires.txt +5 -0
  31. daai_console-0.1.0a2/src/daai_console.egg-info/top_level.txt +1 -0
  32. daai_console-0.1.0a2/tests/test_client.py +261 -0
  33. daai_console-0.1.0a2/tests/test_runtime.py +416 -0
@@ -0,0 +1,17 @@
1
+ DAAI Console Alpha SDK License
2
+
3
+ Copyright (c) 2026 DAAI Console.
4
+
5
+ This SDK is provided for alpha evaluation of DAAI Console. You may use, copy,
6
+ and modify this SDK for the purpose of evaluating, testing, and integrating
7
+ DAAI Console during the alpha period.
8
+
9
+ Redistribution, resale, or production use outside an active DAAI Console alpha
10
+ or written agreement requires prior written permission from DAAI Console.
11
+
12
+ THE SDK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
13
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
14
+ PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
15
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER
16
+ IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN
17
+ CONNECTION WITH THE SDK OR THE USE OR OTHER DEALINGS IN THE SDK.
@@ -0,0 +1,7 @@
1
+ include LICENSE
2
+ include README.md
3
+ include pyproject.toml
4
+ recursive-include docs *.md
5
+ recursive-include examples *.py
6
+ recursive-include tests *.py
7
+ recursive-include src/daai_console py.typed
@@ -0,0 +1,241 @@
1
+ Metadata-Version: 2.4
2
+ Name: daai-console
3
+ Version: 0.1.0a2
4
+ Summary: Python SDK for DAAI Console cooperative action governance.
5
+ Author: DAAI Console
6
+ License-Expression: LicenseRef-DAAI-Alpha
7
+ Project-URL: Homepage, https://github.com/sanyAlam/daai-console-python
8
+ Project-URL: Repository, https://github.com/sanyAlam/daai-console-python
9
+ Project-URL: Issues, https://github.com/sanyAlam/daai-console-python/issues
10
+ Keywords: ai,governance,approval,audit,sdk
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: httpx<1.0.0,>=0.28.0
25
+ Provides-Extra: dev
26
+ Requires-Dist: build<2.0.0,>=1.2.0; extra == "dev"
27
+ Requires-Dist: pytest<9.0.0,>=8.4.0; extra == "dev"
28
+ Dynamic: license-file
29
+
30
+ # DAAI Console Python SDK
31
+
32
+ DAAI Console is a governance layer for AI automations. It lets developers intercept risky registered agent actions before execution, route them through policy and approval, and produce audit receipts.
33
+
34
+ This repository contains the public alpha Python SDK for DAAI Console.
35
+
36
+ ## What DAAI Console Is Not
37
+
38
+ DAAI Console is intentionally narrow in alpha. It is not:
39
+
40
+ - Magic interception of arbitrary code
41
+ - A browser automation framework
42
+ - A replacement for MCP
43
+ - An OS-wide agent scanner
44
+ - A full enterprise security platform
45
+
46
+ ## Execution Boundary
47
+
48
+ DAAI Console governs proposal, policy, approval, status, and receipts.
49
+
50
+ The developer application owns real business execution, local business logic, executor functions, external integrations, and worker or cron triggers. Place this SDK before risky functions. The SDK does not execute callbacks inside `intercept()`.
51
+
52
+ ## Install
53
+
54
+ From PyPI:
55
+
56
+ ```bash
57
+ pip install daai-console
58
+ ```
59
+
60
+ Alpha pinning:
61
+
62
+ ```bash
63
+ pip install daai-console==0.1.0a2
64
+ ```
65
+
66
+ ## Environment
67
+
68
+ Set these values in your server-side environment:
69
+
70
+ ```bash
71
+ export DAAI_API_KEY="..."
72
+ export DAAI_WORKSPACE_KEY="..."
73
+ export DAAI_BASE_URL="https://your-daai-api.example.com"
74
+ ```
75
+
76
+ Do not expose these values in browser code or frontend bundles.
77
+
78
+ ## Minimal Client Example
79
+
80
+ ```python
81
+ import os
82
+
83
+ from daai_console import DaaiClient
84
+
85
+ client = DaaiClient(
86
+ base_url=os.environ["DAAI_BASE_URL"],
87
+ api_key=os.environ["DAAI_API_KEY"],
88
+ workspace_key=os.environ["DAAI_WORKSPACE_KEY"],
89
+ )
90
+
91
+ payload = {
92
+ "invoice_id": "INV-1025",
93
+ "customer_name": "Acme Finance",
94
+ "amount": 1250,
95
+ }
96
+
97
+ proposal = client.intercept(
98
+ action="send_invoice_reminder",
99
+ payload=payload,
100
+ idempotency_key="invoice-reminder:INV-1025",
101
+ )
102
+
103
+ print(proposal.governance_status.value)
104
+ print(proposal.executable)
105
+
106
+ status = client.status(proposal.action_run_id)
107
+
108
+ if status.executable:
109
+ try:
110
+ # Your app owns the real business execution.
111
+ provider_result = send_invoice_reminder(payload)
112
+ client.report_executed(
113
+ proposal.action_run_id,
114
+ execution_result={"provider_id": provider_result["id"]},
115
+ )
116
+ except Exception as exc:
117
+ client.report_failed(
118
+ proposal.action_run_id,
119
+ execution_error=f"{type(exc).__name__}: {exc}",
120
+ )
121
+ else:
122
+ print("Not executable yet. Wait for approval or policy decision.")
123
+ ```
124
+
125
+ ## Runtime Helper Example
126
+
127
+ The runtime helpers make the safe path easier: propose once, persist pending approvals locally, and run only after DAAI Console reports `executable=true`.
128
+
129
+ ```python
130
+ import os
131
+
132
+ from daai_console import (
133
+ DaaiActionRunner,
134
+ DaaiClient,
135
+ PendingActionManager,
136
+ SQLitePendingStore,
137
+ )
138
+
139
+ client = DaaiClient(
140
+ base_url=os.environ["DAAI_BASE_URL"],
141
+ api_key=os.environ["DAAI_API_KEY"],
142
+ workspace_key=os.environ["DAAI_WORKSPACE_KEY"],
143
+ )
144
+ store = SQLitePendingStore("daai_pending_actions.sqlite3")
145
+ manager = PendingActionManager(client=client, pending_store=store)
146
+
147
+ manager.propose(
148
+ action="send_invoice_reminder",
149
+ payload={"invoice_id": "INV-1025", "amount": 1250},
150
+ idempotency_key="invoice-reminder:INV-1025",
151
+ )
152
+
153
+
154
+ def send_invoice_reminder_executor(payload: dict) -> dict:
155
+ # Keep your existing execution function here.
156
+ return {"message_id": "example-local-result"}
157
+
158
+
159
+ runner = DaaiActionRunner(client=client, pending_store=store)
160
+ runner.when_executable(
161
+ action="send_invoice_reminder",
162
+ run=send_invoice_reminder_executor,
163
+ )
164
+
165
+ executed_count = runner.run_pending_once()
166
+ print(f"Executed {executed_count} approved action(s).")
167
+ ```
168
+
169
+ ## Live Alpha Smoke Tests
170
+
171
+ The unit tests in `tests/` are mocked SDK-internal tests. They do not call DAAI Console and should remain safe for normal local runs and CI.
172
+
173
+ The scripts in `examples/live_*.py` are opt-in live smoke tests for alpha testers with real DAAI Console credentials. They call the configured API and should be run manually against a staging or alpha workspace.
174
+
175
+ Before running live scripts, make sure the action is already registered in your DAAI Console workspace. The default expected action is `send_invoice_reminder`. You can override it with `DAAI_TEST_ACTION_NAME`.
176
+
177
+ Set required environment variables:
178
+
179
+ ```bash
180
+ export DAAI_API_KEY="..."
181
+ export DAAI_WORKSPACE_KEY="..."
182
+ export DAAI_BASE_URL="https://stage.api.daaihq.com"
183
+ ```
184
+
185
+ `DAAI_BASE_URL` must point to the API, not the dashboard. For staging, use `https://stage.api.daaihq.com`, not `https://stage.daaihq.com`.
186
+
187
+ Optional environment variables:
188
+
189
+ ```bash
190
+ export DAAI_TEST_ACTION_NAME="send_invoice_reminder"
191
+ export DAAI_PENDING_DB_PATH="./daai_alpha_pending.db"
192
+ ```
193
+
194
+ Run the low-level client smoke test:
195
+
196
+ ```bash
197
+ python examples/live_client_smoke.py
198
+ ```
199
+
200
+ Run the runtime smoke flow:
201
+
202
+ ```bash
203
+ python examples/live_runtime_smoke.py propose
204
+ python examples/live_runtime_smoke.py list-pending
205
+ ```
206
+
207
+ If the proposal returns `pending_approval`, approve it from the approval email or dashboard. The SDK does not auto-approve and does not bypass governance. After approval, run:
208
+
209
+ ```bash
210
+ python examples/live_runtime_smoke.py run-pending
211
+ ```
212
+
213
+ `run-pending` uses `DaaiActionRunner` and a fake executor. It only simulates execution, and only runs when DAAI Console reports `executable=true`.
214
+
215
+ If the API returns `blocked` or `unknown_action`, it usually means the action is not registered in the workspace, the API/workspace key belongs to another workspace, or the action name does not match exactly. Register the action in the dashboard first, then rerun the script with the same action name.
216
+
217
+ ## Security Notes
218
+
219
+ - Store `DAAI_API_KEY` and `DAAI_WORKSPACE_KEY` server-side only.
220
+ - Do not expose keys in browser or frontend code.
221
+ - Approval links should not contain sensitive payload data.
222
+ - Local pending stores may contain business payloads; treat them as sensitive.
223
+ - The SDK does not execute callbacks inside `intercept()`.
224
+ - Rejected and blocked actions should not execute.
225
+
226
+ ## Known Limitations
227
+
228
+ - Python SDK first.
229
+ - Cooperative interception only.
230
+ - Developers must register and gate actions explicitly.
231
+ - No automatic arbitrary-code interception.
232
+ - Staging alpha APIs may change.
233
+ - No enterprise RBAC in alpha.
234
+
235
+ ## Alpha Docs
236
+
237
+ - [Alpha test checklist](docs/alpha-test-checklist.md)
238
+ - [Security model](docs/security-model.md)
239
+ - [Agency adoption prompt](docs/agency-adoption-prompt.md)
240
+ - [Known limitations](docs/known-limitations.md)
241
+ - [Staging alpha guide](docs/staging-alpha-guide.md)
@@ -0,0 +1,212 @@
1
+ # DAAI Console Python SDK
2
+
3
+ DAAI Console is a governance layer for AI automations. It lets developers intercept risky registered agent actions before execution, route them through policy and approval, and produce audit receipts.
4
+
5
+ This repository contains the public alpha Python SDK for DAAI Console.
6
+
7
+ ## What DAAI Console Is Not
8
+
9
+ DAAI Console is intentionally narrow in alpha. It is not:
10
+
11
+ - Magic interception of arbitrary code
12
+ - A browser automation framework
13
+ - A replacement for MCP
14
+ - An OS-wide agent scanner
15
+ - A full enterprise security platform
16
+
17
+ ## Execution Boundary
18
+
19
+ DAAI Console governs proposal, policy, approval, status, and receipts.
20
+
21
+ The developer application owns real business execution, local business logic, executor functions, external integrations, and worker or cron triggers. Place this SDK before risky functions. The SDK does not execute callbacks inside `intercept()`.
22
+
23
+ ## Install
24
+
25
+ From PyPI:
26
+
27
+ ```bash
28
+ pip install daai-console
29
+ ```
30
+
31
+ Alpha pinning:
32
+
33
+ ```bash
34
+ pip install daai-console==0.1.0a2
35
+ ```
36
+
37
+ ## Environment
38
+
39
+ Set these values in your server-side environment:
40
+
41
+ ```bash
42
+ export DAAI_API_KEY="..."
43
+ export DAAI_WORKSPACE_KEY="..."
44
+ export DAAI_BASE_URL="https://your-daai-api.example.com"
45
+ ```
46
+
47
+ Do not expose these values in browser code or frontend bundles.
48
+
49
+ ## Minimal Client Example
50
+
51
+ ```python
52
+ import os
53
+
54
+ from daai_console import DaaiClient
55
+
56
+ client = DaaiClient(
57
+ base_url=os.environ["DAAI_BASE_URL"],
58
+ api_key=os.environ["DAAI_API_KEY"],
59
+ workspace_key=os.environ["DAAI_WORKSPACE_KEY"],
60
+ )
61
+
62
+ payload = {
63
+ "invoice_id": "INV-1025",
64
+ "customer_name": "Acme Finance",
65
+ "amount": 1250,
66
+ }
67
+
68
+ proposal = client.intercept(
69
+ action="send_invoice_reminder",
70
+ payload=payload,
71
+ idempotency_key="invoice-reminder:INV-1025",
72
+ )
73
+
74
+ print(proposal.governance_status.value)
75
+ print(proposal.executable)
76
+
77
+ status = client.status(proposal.action_run_id)
78
+
79
+ if status.executable:
80
+ try:
81
+ # Your app owns the real business execution.
82
+ provider_result = send_invoice_reminder(payload)
83
+ client.report_executed(
84
+ proposal.action_run_id,
85
+ execution_result={"provider_id": provider_result["id"]},
86
+ )
87
+ except Exception as exc:
88
+ client.report_failed(
89
+ proposal.action_run_id,
90
+ execution_error=f"{type(exc).__name__}: {exc}",
91
+ )
92
+ else:
93
+ print("Not executable yet. Wait for approval or policy decision.")
94
+ ```
95
+
96
+ ## Runtime Helper Example
97
+
98
+ The runtime helpers make the safe path easier: propose once, persist pending approvals locally, and run only after DAAI Console reports `executable=true`.
99
+
100
+ ```python
101
+ import os
102
+
103
+ from daai_console import (
104
+ DaaiActionRunner,
105
+ DaaiClient,
106
+ PendingActionManager,
107
+ SQLitePendingStore,
108
+ )
109
+
110
+ client = DaaiClient(
111
+ base_url=os.environ["DAAI_BASE_URL"],
112
+ api_key=os.environ["DAAI_API_KEY"],
113
+ workspace_key=os.environ["DAAI_WORKSPACE_KEY"],
114
+ )
115
+ store = SQLitePendingStore("daai_pending_actions.sqlite3")
116
+ manager = PendingActionManager(client=client, pending_store=store)
117
+
118
+ manager.propose(
119
+ action="send_invoice_reminder",
120
+ payload={"invoice_id": "INV-1025", "amount": 1250},
121
+ idempotency_key="invoice-reminder:INV-1025",
122
+ )
123
+
124
+
125
+ def send_invoice_reminder_executor(payload: dict) -> dict:
126
+ # Keep your existing execution function here.
127
+ return {"message_id": "example-local-result"}
128
+
129
+
130
+ runner = DaaiActionRunner(client=client, pending_store=store)
131
+ runner.when_executable(
132
+ action="send_invoice_reminder",
133
+ run=send_invoice_reminder_executor,
134
+ )
135
+
136
+ executed_count = runner.run_pending_once()
137
+ print(f"Executed {executed_count} approved action(s).")
138
+ ```
139
+
140
+ ## Live Alpha Smoke Tests
141
+
142
+ The unit tests in `tests/` are mocked SDK-internal tests. They do not call DAAI Console and should remain safe for normal local runs and CI.
143
+
144
+ The scripts in `examples/live_*.py` are opt-in live smoke tests for alpha testers with real DAAI Console credentials. They call the configured API and should be run manually against a staging or alpha workspace.
145
+
146
+ Before running live scripts, make sure the action is already registered in your DAAI Console workspace. The default expected action is `send_invoice_reminder`. You can override it with `DAAI_TEST_ACTION_NAME`.
147
+
148
+ Set required environment variables:
149
+
150
+ ```bash
151
+ export DAAI_API_KEY="..."
152
+ export DAAI_WORKSPACE_KEY="..."
153
+ export DAAI_BASE_URL="https://stage.api.daaihq.com"
154
+ ```
155
+
156
+ `DAAI_BASE_URL` must point to the API, not the dashboard. For staging, use `https://stage.api.daaihq.com`, not `https://stage.daaihq.com`.
157
+
158
+ Optional environment variables:
159
+
160
+ ```bash
161
+ export DAAI_TEST_ACTION_NAME="send_invoice_reminder"
162
+ export DAAI_PENDING_DB_PATH="./daai_alpha_pending.db"
163
+ ```
164
+
165
+ Run the low-level client smoke test:
166
+
167
+ ```bash
168
+ python examples/live_client_smoke.py
169
+ ```
170
+
171
+ Run the runtime smoke flow:
172
+
173
+ ```bash
174
+ python examples/live_runtime_smoke.py propose
175
+ python examples/live_runtime_smoke.py list-pending
176
+ ```
177
+
178
+ If the proposal returns `pending_approval`, approve it from the approval email or dashboard. The SDK does not auto-approve and does not bypass governance. After approval, run:
179
+
180
+ ```bash
181
+ python examples/live_runtime_smoke.py run-pending
182
+ ```
183
+
184
+ `run-pending` uses `DaaiActionRunner` and a fake executor. It only simulates execution, and only runs when DAAI Console reports `executable=true`.
185
+
186
+ If the API returns `blocked` or `unknown_action`, it usually means the action is not registered in the workspace, the API/workspace key belongs to another workspace, or the action name does not match exactly. Register the action in the dashboard first, then rerun the script with the same action name.
187
+
188
+ ## Security Notes
189
+
190
+ - Store `DAAI_API_KEY` and `DAAI_WORKSPACE_KEY` server-side only.
191
+ - Do not expose keys in browser or frontend code.
192
+ - Approval links should not contain sensitive payload data.
193
+ - Local pending stores may contain business payloads; treat them as sensitive.
194
+ - The SDK does not execute callbacks inside `intercept()`.
195
+ - Rejected and blocked actions should not execute.
196
+
197
+ ## Known Limitations
198
+
199
+ - Python SDK first.
200
+ - Cooperative interception only.
201
+ - Developers must register and gate actions explicitly.
202
+ - No automatic arbitrary-code interception.
203
+ - Staging alpha APIs may change.
204
+ - No enterprise RBAC in alpha.
205
+
206
+ ## Alpha Docs
207
+
208
+ - [Alpha test checklist](docs/alpha-test-checklist.md)
209
+ - [Security model](docs/security-model.md)
210
+ - [Agency adoption prompt](docs/agency-adoption-prompt.md)
211
+ - [Known limitations](docs/known-limitations.md)
212
+ - [Staging alpha guide](docs/staging-alpha-guide.md)
@@ -0,0 +1,69 @@
1
+ # Agency Adoption Prompt
2
+
3
+ Use this prompt inside Codex, Claude, or another coding assistant when adapting an existing client project to DAAI Console. It is intentionally scoped: adopt DAAI Console one risky action at a time, without broad rewrites.
4
+
5
+ ## Copy-Paste Prompt
6
+
7
+ ````text
8
+ You are helping me evaluate and integrate DAAI Console into an existing software project.
9
+
10
+ DAAI Console is a governance layer for AI automations. It lets developers intercept risky registered agent actions before execution, route them through deterministic policy and client approval, and produce audit receipts.
11
+
12
+ Important boundary:
13
+ - DAAI Console performs cooperative pre-execution interception for registered actions.
14
+ - DAAI Console does not magically intercept all AI activity.
15
+ - DAAI Console does not execute my business callback inside intercept().
16
+ - My application still owns real execution, local business logic, executor functions, external integrations, and worker or cron triggers.
17
+ - The SDK must be placed before the risky function.
18
+
19
+ Your job:
20
+ 1. Explain DAAI Console clearly in simple terms with real Python code snippets.
21
+ 2. Explain how the runtime helpers manage pending approvals:
22
+ - PendingActionManager proposes and stores pending approvals.
23
+ - SQLitePendingStore persists pending action state across restarts.
24
+ - DaaiActionRunner polls DAAI Console and only runs executors when executable=true.
25
+ 3. Do not refactor the whole project.
26
+ 4. Do not inspect my project files until I explicitly approve that step.
27
+ 5. Identify one risky action at a time.
28
+ 6. Ask a follow-up question before changing code.
29
+ 7. Preserve existing code stability.
30
+ 8. Add DAAI Console as a gate before one selected risky action.
31
+ 9. Keep my existing execution function unchanged where possible.
32
+ 10. Add tests around the single adapted action.
33
+
34
+ When showing code, use the public package name and import path:
35
+
36
+ ```python
37
+ from daai_console import DaaiClient
38
+ ```
39
+
40
+ Use these environment variables:
41
+ - DAAI_API_KEY
42
+ - DAAI_WORKSPACE_KEY
43
+ - DAAI_BASE_URL
44
+
45
+ Show examples for:
46
+ - client.intercept(...)
47
+ - client.status(...)
48
+ - client.report_executed(...)
49
+ - client.report_failed(...)
50
+ - PendingActionManager
51
+ - SQLitePendingStore
52
+ - DaaiActionRunner
53
+ - runner.when_executable(...)
54
+ - runner.run_pending_once()
55
+
56
+ Your first response must do exactly this:
57
+ 1. Explain DAAI Console in simple terms.
58
+ 2. State that DAAI Console performs cooperative pre-execution interception for registered actions.
59
+ 3. State that it does not magically intercept all AI activity.
60
+ 4. Explain that adoption should happen one critical action at a time.
61
+ 5. Ask me what I want to do next with these numbered options:
62
+ 1. Learn DAAI Console deeper
63
+ 2. Identify risky actions in this project
64
+ 3. Integrate DAAI Console around one selected action
65
+ 4. Understand policy/approval flow
66
+ 5. Add a worker/runner for approved actions
67
+
68
+ Do not change files until I choose an option and explicitly approve inspection or edits.
69
+ ````
@@ -0,0 +1,81 @@
1
+ # Alpha Test Checklist
2
+
3
+ This checklist is written for cybersecurity-minded alpha testers evaluating the DAAI Console Python SDK.
4
+
5
+ ## Before Running The Live Scripts
6
+
7
+ - Sign up or log in to DAAI Console.
8
+ - Create or select a workspace.
9
+ - Copy a server-side API key.
10
+ - Copy the workspace key.
11
+ - Register an action named `send_invoice_reminder`.
12
+ - Set the action policy to `always_require_approval` for the first smoke test.
13
+ - Set the approver email for the workspace/action.
14
+ - Export `DAAI_API_KEY`, `DAAI_WORKSPACE_KEY`, and `DAAI_BASE_URL`.
15
+ - Confirm `DAAI_BASE_URL` points to the API, for example `https://stage.api.daaihq.com`, not the dashboard.
16
+ - Run `python examples/live_client_smoke.py`.
17
+ - Approve the action from the approval email or dashboard.
18
+ - Run `python examples/live_runtime_smoke.py propose`.
19
+ - Run `python examples/live_runtime_smoke.py run-pending` after approval.
20
+
21
+ ## Setup Verification
22
+
23
+ - Install the SDK from the local wheel: `pip install ./dist/daai_console-0.1.0a2-py3-none-any.whl`
24
+ - Configure `DAAI_BASE_URL` in a server-side environment.
25
+ - Configure `DAAI_API_KEY` in a server-side environment.
26
+ - Configure `DAAI_WORKSPACE_KEY` in a server-side environment.
27
+ - Run `python examples/staging_alpha_test.py --dry-run` to confirm the example can load safely without making API calls.
28
+ - Run `python examples/staging_alpha_test.py` against the staging API when ready.
29
+
30
+ ## Happy Path
31
+
32
+ - Propose a registered risky action with `intercept()` or `PendingActionManager.propose()`.
33
+ - Observe `governance_status=pending_approval` and `executable=false`.
34
+ - Receive the approval email at the configured approver address.
35
+ - Approve the action from the email approval link.
36
+ - Confirm `status()` returns `executable=true`.
37
+ - Run the local executor through `DaaiActionRunner.run_pending_once()` or your own guarded worker.
38
+ - Report successful execution with `report_executed()`.
39
+ - Verify the receipt in the dashboard action-run detail view.
40
+
41
+ ## Negative Path
42
+
43
+ - Confirm a wrong API key fails clearly and does not expose secrets.
44
+ - Confirm a wrong workspace key fails clearly and does not expose secrets.
45
+ - Confirm an unknown action is blocked or rejected by the API.
46
+ - Confirm a pending action does not execute.
47
+ - Confirm a rejected action does not execute.
48
+ - Confirm a blocked action does not execute.
49
+
50
+ ## Local Persistence Test
51
+
52
+ - Propose an action that requires approval using `SQLitePendingStore`.
53
+ - Confirm the pending run persists in the SQLite database.
54
+ - Stop and restart the worker process.
55
+ - Confirm the worker can resume later from the same SQLite file.
56
+ - Confirm the runner only executes when `executable=true`.
57
+
58
+ ## Security Review Questions
59
+
60
+ - Are API keys and workspace keys handled safely?
61
+ - Does the SDK ever execute before approval?
62
+ - Are payloads unnecessarily exposed to DAAI Console or logs?
63
+ - Is the local SQLite store safe enough for the expected use case?
64
+ - Are errors clear without leaking secrets?
65
+ - Are audit receipts clear enough for the client or auditor?
66
+ - Is the approval boundary understandable to developers and approvers?
67
+ - Can a developer accidentally misuse the SDK and execute a risky action anyway?
68
+ - What should be made stricter before public release?
69
+
70
+ ## Feedback Format
71
+
72
+ Please report findings with this structure:
73
+
74
+ ```text
75
+ Security concern:
76
+ Severity:
77
+ Reproduction steps:
78
+ Expected behavior:
79
+ Actual behavior:
80
+ Suggested fix:
81
+ ```
@@ -0,0 +1,14 @@
1
+ # Known Limitations
2
+
3
+ - Python SDK first.
4
+ - Cooperative interception only.
5
+ - Developers must register and gate actions explicitly.
6
+ - No automatic arbitrary-code interception.
7
+ - Staging alpha APIs may change.
8
+ - No enterprise RBAC in alpha.
9
+ - No MCP integration in alpha.
10
+ - No Slack, WhatsApp, or webhook continuation in alpha.
11
+ - Live examples require a registered action.
12
+ - Unknown actions are blocked by design.
13
+ - Approval email is only sent for registered actions whose policy requires approval.
14
+ - The SDK does not auto-approve or bypass governance.
@@ -0,0 +1,50 @@
1
+ # Security Model
2
+
3
+ DAAI Console alpha is a cooperative governance layer for registered agent actions. It is designed to help developers pause risky actions before execution, route those actions through deterministic policy and approval, and preserve an audit trail.
4
+
5
+ ## Threat Model For Alpha
6
+
7
+ The alpha assumes a developer intentionally integrates the SDK before selected risky actions. The developer app is trusted to call DAAI Console before executing those actions and to respect `executable=false` decisions.
8
+
9
+ The alpha is mainly concerned with accidental execution before approval, unclear audit trails, local loss of pending approval state, and ambiguous execution reporting.
10
+
11
+ ## What The SDK Protects Against
12
+
13
+ - Accidental execution before approval when developers use the SDK/runtime as intended.
14
+ - Missing approval audit trail for registered actions governed by DAAI Console.
15
+ - Loss of pending action state when `SQLitePendingStore` is used.
16
+ - Unclear execution reporting by providing explicit `report_executed()` and `report_failed()` calls.
17
+
18
+ ## What The SDK Does Not Protect Against
19
+
20
+ - A malicious developer bypassing the SDK.
21
+ - Compromised API keys or workspace keys.
22
+ - A compromised host machine.
23
+ - A malicious external integration called by the developer app.
24
+ - A developer storing payloads insecurely.
25
+ - Arbitrary code execution that was never registered or gated through DAAI Console.
26
+
27
+ ## Trust Boundary
28
+
29
+ The trust boundary has five parts:
30
+
31
+ - SDK: proposes actions, checks status, reports execution, and optionally stores pending actions locally.
32
+ - DAAI Console API: validates keys, evaluates deterministic policy, manages approval state, and records receipts.
33
+ - Developer application: decides where to place the gate and owns business logic.
34
+ - Local executor: performs the real external action only after approval or allow decision.
35
+ - Approval email recipient: reviews the approval context and approves or rejects the action.
36
+
37
+ ## Key Handling Rules
38
+
39
+ - Keep API keys and workspace keys server-side only.
40
+ - Never place keys in browser JavaScript, mobile apps, public repositories, or logs.
41
+ - Rotate or revoke keys immediately if leaked.
42
+ - Use separate keys per environment when possible.
43
+
44
+ ## Payload Handling
45
+
46
+ - Send only what is needed for approval and audit.
47
+ - Avoid unnecessary secrets, tokens, credentials, and sensitive PII in payloads.
48
+ - Approval links should not contain sensitive payload data.
49
+ - Local pending stores can contain sensitive business payloads.
50
+ - Protect SQLite files with normal server file permissions, disk encryption where appropriate, and environment-specific retention policies.