makoto 0.1.0__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 (65) hide show
  1. makoto-0.1.0/CHANGELOG.md +16 -0
  2. makoto-0.1.0/CONTRIBUTING.md +29 -0
  3. makoto-0.1.0/LICENSE +22 -0
  4. makoto-0.1.0/MANIFEST.in +10 -0
  5. makoto-0.1.0/PKG-INFO +294 -0
  6. makoto-0.1.0/README.md +274 -0
  7. makoto-0.1.0/SECURITY.md +28 -0
  8. makoto-0.1.0/examples/README.md +99 -0
  9. makoto-0.1.0/examples/campaign.json +21 -0
  10. makoto-0.1.0/examples/ci_safety_demo.py +50 -0
  11. makoto-0.1.0/examples/claude_style_adapter_demo.py +57 -0
  12. makoto-0.1.0/examples/customer_support_safety_demo.py +60 -0
  13. makoto-0.1.0/examples/deploy_denied_demo.py +56 -0
  14. makoto-0.1.0/examples/finance_safety_demo.py +60 -0
  15. makoto-0.1.0/examples/framework_adapter_demo.py +64 -0
  16. makoto-0.1.0/examples/gemini_style_adapter_demo.py +57 -0
  17. makoto-0.1.0/examples/local_agent_loop.py +76 -0
  18. makoto-0.1.0/examples/one_file_demo.py +81 -0
  19. makoto-0.1.0/examples/openai_style_adapter_demo.py +59 -0
  20. makoto-0.1.0/examples/research_safety_demo.py +60 -0
  21. makoto-0.1.0/makoto/__init__.py +28 -0
  22. makoto-0.1.0/makoto/adapters/__init__.py +18 -0
  23. makoto-0.1.0/makoto/adapters/autogen.py +27 -0
  24. makoto-0.1.0/makoto/adapters/base.py +65 -0
  25. makoto-0.1.0/makoto/adapters/claude.py +59 -0
  26. makoto-0.1.0/makoto/adapters/crewai.py +17 -0
  27. makoto-0.1.0/makoto/adapters/gemini.py +60 -0
  28. makoto-0.1.0/makoto/adapters/langgraph.py +37 -0
  29. makoto-0.1.0/makoto/adapters/openai.py +55 -0
  30. makoto-0.1.0/makoto/cli.py +501 -0
  31. makoto-0.1.0/makoto/control/__init__.py +2 -0
  32. makoto-0.1.0/makoto/control/errors.py +11 -0
  33. makoto-0.1.0/makoto/control/policy.py +57 -0
  34. makoto-0.1.0/makoto/ledger/__init__.py +2 -0
  35. makoto-0.1.0/makoto/ledger/sqlite_ledger.py +185 -0
  36. makoto-0.1.0/makoto/protocol/__init__.py +2 -0
  37. makoto-0.1.0/makoto/protocol/canonical_json.py +31 -0
  38. makoto-0.1.0/makoto/protocol/json_schema.py +97 -0
  39. makoto-0.1.0/makoto/protocol/schemas.py +176 -0
  40. makoto-0.1.0/makoto/protocol/signing.py +98 -0
  41. makoto-0.1.0/makoto/protocol/verifier.py +88 -0
  42. makoto-0.1.0/makoto/py.typed +1 -0
  43. makoto-0.1.0/makoto/sdk/__init__.py +10 -0
  44. makoto-0.1.0/makoto/sdk/catalog.py +62 -0
  45. makoto-0.1.0/makoto/sdk/client.py +366 -0
  46. makoto-0.1.0/makoto/tooling.py +36 -0
  47. makoto-0.1.0/makoto/ux/__init__.py +3 -0
  48. makoto-0.1.0/makoto/ux/mascot.py +14 -0
  49. makoto-0.1.0/makoto.egg-info/PKG-INFO +294 -0
  50. makoto-0.1.0/makoto.egg-info/SOURCES.txt +63 -0
  51. makoto-0.1.0/makoto.egg-info/dependency_links.txt +1 -0
  52. makoto-0.1.0/makoto.egg-info/entry_points.txt +2 -0
  53. makoto-0.1.0/makoto.egg-info/top_level.txt +1 -0
  54. makoto-0.1.0/pyproject.toml +32 -0
  55. makoto-0.1.0/rfcs/001-campaign-permit.md +21 -0
  56. makoto-0.1.0/rfcs/002-signed-work-order.md +19 -0
  57. makoto-0.1.0/rfcs/003-proof-carrying-tool-call.md +20 -0
  58. makoto-0.1.0/schemas/attestation.schema.json +82 -0
  59. makoto-0.1.0/schemas/campaign.schema.json +110 -0
  60. makoto-0.1.0/schemas/outcome.schema.json +101 -0
  61. makoto-0.1.0/schemas/tool-call.schema.json +97 -0
  62. makoto-0.1.0/schemas/witness-report.schema.json +77 -0
  63. makoto-0.1.0/schemas/work-order.schema.json +106 -0
  64. makoto-0.1.0/setup.cfg +4 -0
  65. makoto-0.1.0/tests/test_end_to_end.py +379 -0
@@ -0,0 +1,16 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0
4
+
5
+ Initial OSS developer release.
6
+
7
+ - Signed mission campaign permits
8
+ - Signed work orders
9
+ - Proof-carrying tool calls
10
+ - Local protected tool decorator
11
+ - Local SQLite development ledger
12
+ - Protocol verifier
13
+ - JSON Schema export
14
+ - CLI commands: `demo`, `init`, `sign`, `verify`, `export-schemas`, `doctor`, `version`
15
+ - Neutral examples for CI, research, finance, customer support, and deploy-denied safety
16
+
@@ -0,0 +1,29 @@
1
+ # Contributing
2
+
3
+ MAKOTO keeps the open-source surface small and stable:
4
+
5
+ - protocol schemas
6
+ - canonical JSON and hashing
7
+ - local verifier
8
+ - basic SDK
9
+ - local SQLite development ledger
10
+ - examples and tests
11
+
12
+ Enterprise enforcement, policy engines, swarm routing, MCP proxying, dashboards,
13
+ causal learning, and regulated deployment templates are not part of this OSS
14
+ package.
15
+
16
+ ## Compatibility
17
+
18
+ Before a `1.0.0` release, fields may change. After `1.0.0`:
19
+
20
+ - optional fields can be added in minor versions
21
+ - breaking schema changes require a major version
22
+ - public schema changes should go through an RFC
23
+
24
+ ## Testing
25
+
26
+ ```bash
27
+ python3 -m unittest discover -s tests -v
28
+ ```
29
+
makoto-0.1.0/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Quantryx
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,10 @@
1
+ include README.md
2
+ include LICENSE
3
+ include CHANGELOG.md
4
+ include SECURITY.md
5
+ include CONTRIBUTING.md
6
+ recursive-include rfcs *.md
7
+ recursive-include examples *.py *.json *.md
8
+ recursive-include schemas *.json
9
+ include makoto/py.typed
10
+
makoto-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,294 @@
1
+ Metadata-Version: 2.4
2
+ Name: makoto
3
+ Version: 0.1.0
4
+ Summary: MAKOTO: Mission Integrity for Autonomous Agent Swarms
5
+ Author: Quantryx
6
+ License: MIT
7
+ Keywords: agents,ai,authorization,audit,control-plane
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Topic :: Security
15
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
+ Requires-Python: >=3.11
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Dynamic: license-file
20
+
21
+ <p align="center">
22
+ <img src="assets/logo.svg" alt="MAKOTO logo" width="720">
23
+ </p>
24
+
25
+ <p align="center">
26
+ <a href="https://github.com/quantryx/makoto/actions/workflows/tests.yml"><img alt="tests" src="https://img.shields.io/github/actions/workflow/status/quantryx/makoto/tests.yml?branch=main&label=tests"></a>
27
+ <a href="https://pypi.org/project/makoto/"><img alt="pypi" src="https://img.shields.io/pypi/v/makoto.svg"></a>
28
+ <img alt="python" src="https://img.shields.io/badge/python-3.11%2B-blue">
29
+ <img alt="license" src="https://img.shields.io/badge/license-MIT-green">
30
+ </p>
31
+
32
+ # MAKOTO
33
+
34
+ **Your AI agent should not be able to deploy production just because it can call a tool.**
35
+
36
+ MAKOTO gives agents signed, bounded missions. A tool runs only when the agent
37
+ brings a valid proof-carrying tool call.
38
+
39
+ ```text
40
+ agent: deploy production
41
+ tool: DENIED - missing signed work order
42
+ ```
43
+
44
+ MAKOTO is not another agent framework. It is the missing control layer for
45
+ agent frameworks.
46
+
47
+ > Agents do not get broad permissions. They get signed missions.
48
+
49
+ ## Install
50
+
51
+ ```bash
52
+ python3 -m venv .venv
53
+ .venv/bin/python -m pip install -e .
54
+ .venv/bin/python examples/deploy_denied_demo.py
55
+ ```
56
+
57
+ Expected:
58
+
59
+ ```text
60
+ DENIED: Tool is explicitly forbidden: deploy_production
61
+ BLOCKED BY TOOL: Tool deploy_production requires a MAKOTO proof
62
+ ```
63
+
64
+ Or run the one-file copy-paste demo:
65
+
66
+ ```bash
67
+ python3 examples/one_file_demo.py
68
+ ```
69
+
70
+ ## Why This Exists
71
+
72
+ Most agent frameworks answer:
73
+
74
+ > How can an agent complete this task?
75
+
76
+ MAKOTO answers:
77
+
78
+ > Is this agent allowed to run this tool, for this mission, right now?
79
+
80
+ That difference matters when agents can merge code, send email, move money,
81
+ close accounts, rotate secrets, call APIs, or deploy production.
82
+
83
+ ## What OSS Includes
84
+
85
+ - `MissionCampaignPermit`
86
+ - `SignedWorkOrder`
87
+ - `ProofCarryingToolCall`
88
+ - `OutcomeRecord`
89
+ - signed audit events
90
+ - resource conflict locking
91
+ - campaign replay
92
+ - local SQLite ledger for development
93
+ - `@protected_tool(...)` decorator
94
+ - dangerous tool catalog with risk scores
95
+ - CLI: `makoto demo`, `makoto wrap`, `makoto explain`, `makoto score`, `makoto check`, `makoto init`, `makoto sign`, `makoto verify`, `makoto export-schemas`
96
+ - release helpers: `makoto version`, `makoto doctor`
97
+ - dependency-free adapters for OpenAI-style, Claude-style, Gemini-style, LangGraph-style, CrewAI-style, and AutoGen-style tool calls
98
+
99
+ ## What MAKOTO Is Not
100
+
101
+ - Not an agent framework
102
+ - Not a sandbox
103
+ - Not a production gateway by itself
104
+ - Not a compliance certification
105
+
106
+ MAKOTO OSS is the protocol, SDK, verifier, and local enforcement reference.
107
+
108
+ ## 30-Second Demo
109
+
110
+ ```bash
111
+ makoto demo
112
+ makoto demo --short
113
+ python3 examples/one_file_demo.py
114
+ ```
115
+
116
+ The default demo uses a generic pull-request safety workflow: an AI agent may
117
+ read CI logs and run tests, but it cannot merge, deploy, or rotate secrets
118
+ without a signed work order that allows those tools.
119
+
120
+ ## Create A Quickstart Project
121
+
122
+ ```bash
123
+ makoto init my-makoto-demo
124
+ cd my-makoto-demo
125
+ python app.py
126
+ ```
127
+
128
+ ## Public Use Cases
129
+
130
+ The OSS examples are intentionally neutral and useful for most developers:
131
+
132
+ - CI / Pull Request Safety: read logs and run tests, but do not merge or deploy.
133
+ - Research Agent Safety: read notes and write summaries, but do not send email.
134
+ - Finance Review Safety: draft approval notes, but do not send payments.
135
+ - Customer Support Safety: draft replies, but do not issue refunds.
136
+
137
+ Run them:
138
+
139
+ ```bash
140
+ python3 examples/one_file_demo.py
141
+ python3 examples/deploy_denied_demo.py
142
+ python3 examples/local_agent_loop.py
143
+ python3 examples/ci_safety_demo.py
144
+ python3 examples/research_safety_demo.py
145
+ python3 examples/finance_safety_demo.py
146
+ python3 examples/customer_support_safety_demo.py
147
+ python3 examples/openai_style_adapter_demo.py
148
+ python3 examples/claude_style_adapter_demo.py
149
+ python3 examples/gemini_style_adapter_demo.py
150
+ python3 examples/framework_adapter_demo.py
151
+ ```
152
+
153
+ ## Connect It To Your Agent
154
+
155
+ MAKOTO works with any setup where your application receives a tool call and then
156
+ executes it:
157
+
158
+ - local Python agents
159
+ - local LLMs through Ollama, llama.cpp, vLLM, or custom runners
160
+ - OpenAI-style tool calling
161
+ - Claude-style tool calling
162
+ - Gemini-style function calling
163
+ - LangGraph / CrewAI / AutoGen
164
+ - MCP servers
165
+
166
+ Pattern:
167
+
168
+ ```text
169
+ model requests tool -> MAKOTO authorizes -> protected tool verifies -> tool runs
170
+ ```
171
+
172
+ See [docs/INTEGRATIONS.md](docs/INTEGRATIONS.md).
173
+
174
+ ## Wrap Any Command
175
+
176
+ Use `makoto wrap` to put a local command behind a MAKOTO tool check.
177
+
178
+ Without a signed work order, the command is denied and a denial explanation JSON
179
+ is written to `/tmp`:
180
+
181
+ ```bash
182
+ makoto wrap --tool deploy_production -- echo "deploying..."
183
+ makoto explain /tmp/makoto_denied_deploy_production.json
184
+ ```
185
+
186
+ For local demos, `--allow-dev` creates a short-lived development mission first:
187
+
188
+ ```bash
189
+ makoto wrap --tool run_tests --allow-dev -- python3 -c "print('tests passed')"
190
+ ```
191
+
192
+ Production tools should verify `MAKOTO_PROOF` or use `@protected_tool(...)`
193
+ inside the tool boundary.
194
+
195
+ ## Safety Score
196
+
197
+ Score how much MAKOTO coverage a local project has:
198
+
199
+ ```bash
200
+ makoto score
201
+ ```
202
+
203
+ The score checks for dangerous tool names, `@protected_tool(...)` usage,
204
+ campaigns, signed work orders, proof-carrying tool calls, and recorded outcomes.
205
+
206
+ ## Minimal Code
207
+
208
+ ```python
209
+ from makoto import MakotoClient, protected_tool
210
+
211
+ client = MakotoClient()
212
+
213
+ # After creating a campaign and signed work order:
214
+ proof = client.authorize_tool_call(
215
+ work_order_id=work_order.work_order_id,
216
+ agent_id="ci-agent-01",
217
+ tool_name="run_tests",
218
+ tool_input={"pull_request": 42},
219
+ )
220
+
221
+ @protected_tool("run_tests", client)
222
+ def run_tests(*, tool_input):
223
+ return {"passed": True}
224
+
225
+ run_tests(tool_input={"pull_request": 42}, makoto_proof=proof)
226
+ ```
227
+
228
+ ## Core Rule
229
+
230
+ Tools should execute only after verifying a proof-carrying tool call:
231
+
232
+ ```python
233
+ if not client.verify_tool_call(proof):
234
+ raise PermissionError("Missing valid MAKOTO proof chain")
235
+ ```
236
+
237
+ Or wrap a Python tool directly:
238
+
239
+ ```python
240
+ from makoto import protected_tool
241
+
242
+ @protected_tool("run_tests", client)
243
+ def run_tests(*, tool_input):
244
+ return {"passed": True}
245
+
246
+ run_tests(tool_input={"pull_request": 42}, makoto_proof=proof)
247
+ ```
248
+
249
+ ## Protocol Verification
250
+
251
+ The CLI can validate MAKOTO protocol objects without running the enterprise
252
+ gateway:
253
+
254
+ ```bash
255
+ makoto verify campaign examples/campaign.json
256
+ ```
257
+
258
+ If you also provide the development HMAC secret used to sign the object, the CLI
259
+ verifies the signature:
260
+
261
+ ```bash
262
+ MAKOTO_HMAC_SECRET=dev-secret makoto sign campaign examples/campaign.json --out /tmp/campaign.signed.json
263
+ MAKOTO_HMAC_SECRET=dev-secret makoto verify campaign /tmp/campaign.signed.json
264
+ ```
265
+
266
+ ## Export JSON Schemas
267
+
268
+ ```bash
269
+ makoto export-schemas ./schemas
270
+ ```
271
+
272
+ ## Open-Core Boundary
273
+
274
+ Open source:
275
+
276
+ - protocol objects and schema export
277
+ - canonical JSON and hashing
278
+ - basic local signer/verifier
279
+ - local SDK and SQLite development ledger
280
+ - `@protected_tool(...)` local enforcement example
281
+
282
+ Commercial:
283
+
284
+ - non-bypassable gateway
285
+ - Cedar/OPA policy engine
286
+ - MCP tool proxy
287
+ - enterprise Postgres ledger
288
+ - swarm routing, conflict management, and witness orchestration
289
+ - ATC dashboard
290
+ - regulatory/causal/learning layers
291
+
292
+ The current default signer is an HMAC development signer so the core runs
293
+ without external dependencies. The signer boundary is explicit and can be
294
+ replaced with Ed25519/KMS/HSM in production.
makoto-0.1.0/README.md ADDED
@@ -0,0 +1,274 @@
1
+ <p align="center">
2
+ <img src="assets/logo.svg" alt="MAKOTO logo" width="720">
3
+ </p>
4
+
5
+ <p align="center">
6
+ <a href="https://github.com/quantryx/makoto/actions/workflows/tests.yml"><img alt="tests" src="https://img.shields.io/github/actions/workflow/status/quantryx/makoto/tests.yml?branch=main&label=tests"></a>
7
+ <a href="https://pypi.org/project/makoto/"><img alt="pypi" src="https://img.shields.io/pypi/v/makoto.svg"></a>
8
+ <img alt="python" src="https://img.shields.io/badge/python-3.11%2B-blue">
9
+ <img alt="license" src="https://img.shields.io/badge/license-MIT-green">
10
+ </p>
11
+
12
+ # MAKOTO
13
+
14
+ **Your AI agent should not be able to deploy production just because it can call a tool.**
15
+
16
+ MAKOTO gives agents signed, bounded missions. A tool runs only when the agent
17
+ brings a valid proof-carrying tool call.
18
+
19
+ ```text
20
+ agent: deploy production
21
+ tool: DENIED - missing signed work order
22
+ ```
23
+
24
+ MAKOTO is not another agent framework. It is the missing control layer for
25
+ agent frameworks.
26
+
27
+ > Agents do not get broad permissions. They get signed missions.
28
+
29
+ ## Install
30
+
31
+ ```bash
32
+ python3 -m venv .venv
33
+ .venv/bin/python -m pip install -e .
34
+ .venv/bin/python examples/deploy_denied_demo.py
35
+ ```
36
+
37
+ Expected:
38
+
39
+ ```text
40
+ DENIED: Tool is explicitly forbidden: deploy_production
41
+ BLOCKED BY TOOL: Tool deploy_production requires a MAKOTO proof
42
+ ```
43
+
44
+ Or run the one-file copy-paste demo:
45
+
46
+ ```bash
47
+ python3 examples/one_file_demo.py
48
+ ```
49
+
50
+ ## Why This Exists
51
+
52
+ Most agent frameworks answer:
53
+
54
+ > How can an agent complete this task?
55
+
56
+ MAKOTO answers:
57
+
58
+ > Is this agent allowed to run this tool, for this mission, right now?
59
+
60
+ That difference matters when agents can merge code, send email, move money,
61
+ close accounts, rotate secrets, call APIs, or deploy production.
62
+
63
+ ## What OSS Includes
64
+
65
+ - `MissionCampaignPermit`
66
+ - `SignedWorkOrder`
67
+ - `ProofCarryingToolCall`
68
+ - `OutcomeRecord`
69
+ - signed audit events
70
+ - resource conflict locking
71
+ - campaign replay
72
+ - local SQLite ledger for development
73
+ - `@protected_tool(...)` decorator
74
+ - dangerous tool catalog with risk scores
75
+ - CLI: `makoto demo`, `makoto wrap`, `makoto explain`, `makoto score`, `makoto check`, `makoto init`, `makoto sign`, `makoto verify`, `makoto export-schemas`
76
+ - release helpers: `makoto version`, `makoto doctor`
77
+ - dependency-free adapters for OpenAI-style, Claude-style, Gemini-style, LangGraph-style, CrewAI-style, and AutoGen-style tool calls
78
+
79
+ ## What MAKOTO Is Not
80
+
81
+ - Not an agent framework
82
+ - Not a sandbox
83
+ - Not a production gateway by itself
84
+ - Not a compliance certification
85
+
86
+ MAKOTO OSS is the protocol, SDK, verifier, and local enforcement reference.
87
+
88
+ ## 30-Second Demo
89
+
90
+ ```bash
91
+ makoto demo
92
+ makoto demo --short
93
+ python3 examples/one_file_demo.py
94
+ ```
95
+
96
+ The default demo uses a generic pull-request safety workflow: an AI agent may
97
+ read CI logs and run tests, but it cannot merge, deploy, or rotate secrets
98
+ without a signed work order that allows those tools.
99
+
100
+ ## Create A Quickstart Project
101
+
102
+ ```bash
103
+ makoto init my-makoto-demo
104
+ cd my-makoto-demo
105
+ python app.py
106
+ ```
107
+
108
+ ## Public Use Cases
109
+
110
+ The OSS examples are intentionally neutral and useful for most developers:
111
+
112
+ - CI / Pull Request Safety: read logs and run tests, but do not merge or deploy.
113
+ - Research Agent Safety: read notes and write summaries, but do not send email.
114
+ - Finance Review Safety: draft approval notes, but do not send payments.
115
+ - Customer Support Safety: draft replies, but do not issue refunds.
116
+
117
+ Run them:
118
+
119
+ ```bash
120
+ python3 examples/one_file_demo.py
121
+ python3 examples/deploy_denied_demo.py
122
+ python3 examples/local_agent_loop.py
123
+ python3 examples/ci_safety_demo.py
124
+ python3 examples/research_safety_demo.py
125
+ python3 examples/finance_safety_demo.py
126
+ python3 examples/customer_support_safety_demo.py
127
+ python3 examples/openai_style_adapter_demo.py
128
+ python3 examples/claude_style_adapter_demo.py
129
+ python3 examples/gemini_style_adapter_demo.py
130
+ python3 examples/framework_adapter_demo.py
131
+ ```
132
+
133
+ ## Connect It To Your Agent
134
+
135
+ MAKOTO works with any setup where your application receives a tool call and then
136
+ executes it:
137
+
138
+ - local Python agents
139
+ - local LLMs through Ollama, llama.cpp, vLLM, or custom runners
140
+ - OpenAI-style tool calling
141
+ - Claude-style tool calling
142
+ - Gemini-style function calling
143
+ - LangGraph / CrewAI / AutoGen
144
+ - MCP servers
145
+
146
+ Pattern:
147
+
148
+ ```text
149
+ model requests tool -> MAKOTO authorizes -> protected tool verifies -> tool runs
150
+ ```
151
+
152
+ See [docs/INTEGRATIONS.md](docs/INTEGRATIONS.md).
153
+
154
+ ## Wrap Any Command
155
+
156
+ Use `makoto wrap` to put a local command behind a MAKOTO tool check.
157
+
158
+ Without a signed work order, the command is denied and a denial explanation JSON
159
+ is written to `/tmp`:
160
+
161
+ ```bash
162
+ makoto wrap --tool deploy_production -- echo "deploying..."
163
+ makoto explain /tmp/makoto_denied_deploy_production.json
164
+ ```
165
+
166
+ For local demos, `--allow-dev` creates a short-lived development mission first:
167
+
168
+ ```bash
169
+ makoto wrap --tool run_tests --allow-dev -- python3 -c "print('tests passed')"
170
+ ```
171
+
172
+ Production tools should verify `MAKOTO_PROOF` or use `@protected_tool(...)`
173
+ inside the tool boundary.
174
+
175
+ ## Safety Score
176
+
177
+ Score how much MAKOTO coverage a local project has:
178
+
179
+ ```bash
180
+ makoto score
181
+ ```
182
+
183
+ The score checks for dangerous tool names, `@protected_tool(...)` usage,
184
+ campaigns, signed work orders, proof-carrying tool calls, and recorded outcomes.
185
+
186
+ ## Minimal Code
187
+
188
+ ```python
189
+ from makoto import MakotoClient, protected_tool
190
+
191
+ client = MakotoClient()
192
+
193
+ # After creating a campaign and signed work order:
194
+ proof = client.authorize_tool_call(
195
+ work_order_id=work_order.work_order_id,
196
+ agent_id="ci-agent-01",
197
+ tool_name="run_tests",
198
+ tool_input={"pull_request": 42},
199
+ )
200
+
201
+ @protected_tool("run_tests", client)
202
+ def run_tests(*, tool_input):
203
+ return {"passed": True}
204
+
205
+ run_tests(tool_input={"pull_request": 42}, makoto_proof=proof)
206
+ ```
207
+
208
+ ## Core Rule
209
+
210
+ Tools should execute only after verifying a proof-carrying tool call:
211
+
212
+ ```python
213
+ if not client.verify_tool_call(proof):
214
+ raise PermissionError("Missing valid MAKOTO proof chain")
215
+ ```
216
+
217
+ Or wrap a Python tool directly:
218
+
219
+ ```python
220
+ from makoto import protected_tool
221
+
222
+ @protected_tool("run_tests", client)
223
+ def run_tests(*, tool_input):
224
+ return {"passed": True}
225
+
226
+ run_tests(tool_input={"pull_request": 42}, makoto_proof=proof)
227
+ ```
228
+
229
+ ## Protocol Verification
230
+
231
+ The CLI can validate MAKOTO protocol objects without running the enterprise
232
+ gateway:
233
+
234
+ ```bash
235
+ makoto verify campaign examples/campaign.json
236
+ ```
237
+
238
+ If you also provide the development HMAC secret used to sign the object, the CLI
239
+ verifies the signature:
240
+
241
+ ```bash
242
+ MAKOTO_HMAC_SECRET=dev-secret makoto sign campaign examples/campaign.json --out /tmp/campaign.signed.json
243
+ MAKOTO_HMAC_SECRET=dev-secret makoto verify campaign /tmp/campaign.signed.json
244
+ ```
245
+
246
+ ## Export JSON Schemas
247
+
248
+ ```bash
249
+ makoto export-schemas ./schemas
250
+ ```
251
+
252
+ ## Open-Core Boundary
253
+
254
+ Open source:
255
+
256
+ - protocol objects and schema export
257
+ - canonical JSON and hashing
258
+ - basic local signer/verifier
259
+ - local SDK and SQLite development ledger
260
+ - `@protected_tool(...)` local enforcement example
261
+
262
+ Commercial:
263
+
264
+ - non-bypassable gateway
265
+ - Cedar/OPA policy engine
266
+ - MCP tool proxy
267
+ - enterprise Postgres ledger
268
+ - swarm routing, conflict management, and witness orchestration
269
+ - ATC dashboard
270
+ - regulatory/causal/learning layers
271
+
272
+ The current default signer is an HMAC development signer so the core runs
273
+ without external dependencies. The signer boundary is explicit and can be
274
+ replaced with Ed25519/KMS/HSM in production.
@@ -0,0 +1,28 @@
1
+ # Security Policy
2
+
3
+ MAKOTO OSS is a developer protocol and local enforcement reference. It is not a
4
+ complete production gateway.
5
+
6
+ ## Supported Versions
7
+
8
+ | Version | Supported |
9
+ | --- | --- |
10
+ | 0.1.x | Yes |
11
+
12
+ ## Reporting A Vulnerability
13
+
14
+ Do not open public issues for exploitable security vulnerabilities. Send a
15
+ private report to the maintainers with:
16
+
17
+ - affected version
18
+ - reproduction steps
19
+ - expected impact
20
+ - suggested fix, if known
21
+
22
+ ## Important Boundaries
23
+
24
+ - The default HMAC signer is for local development.
25
+ - Production deployments should use Ed25519/KMS/HSM-backed signing.
26
+ - The OSS package demonstrates local tool protection. Non-bypassable gateway and
27
+ MCP proxy enforcement belong in the commercial control plane.
28
+