mythos-sentinel 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +362 -0
- package/action.yml +43 -0
- package/assets/banner.png +0 -0
- package/bin/mythos-sentinel-mcp.js +7 -0
- package/bin/mythos-sentinel.js +8 -0
- package/docs/ARCHITECTURE.md +55 -0
- package/docs/BASE_X402.md +33 -0
- package/docs/BAZAAR_ADAPTER.md +41 -0
- package/docs/DASHBOARD.md +22 -0
- package/docs/FALLBACK_ROUTING.md +37 -0
- package/docs/MCP.md +70 -0
- package/docs/PASSIVE_SCORING.md +33 -0
- package/docs/ROUTESCORE.md +101 -0
- package/docs/RUNTIME_MCP_PROXY.md +90 -0
- package/docs/SPEND_FIREWALL.md +50 -0
- package/docs/TELEMETRY.md +74 -0
- package/docs/THREAT_MODEL.md +28 -0
- package/docs/X402_RECEIPTS.md +54 -0
- package/examples/base/mythos.policy.json +142 -0
- package/examples/claude_desktop/mcp.json +8 -0
- package/examples/codex/AGENTS.md +31 -0
- package/examples/cursor/mcp.json +8 -0
- package/examples/github/verify.yml +29 -0
- package/examples/routescore/services.yml +19 -0
- package/examples/skill/mythos.skill.json +20 -0
- package/package.json +79 -0
- package/schemas/agent-receipt.schema.json +17 -0
- package/schemas/policy.schema.json +322 -0
- package/schemas/sentinel-report.schema.json +14 -0
- package/schemas/skill.manifest.schema.json +42 -0
- package/src/cli.js +570 -0
- package/src/core/fs.js +88 -0
- package/src/core/path-utils.js +54 -0
- package/src/core/policy.js +326 -0
- package/src/core/receipt.js +52 -0
- package/src/core/routescore.js +576 -0
- package/src/core/snapshot.js +35 -0
- package/src/core/telemetry.js +214 -0
- package/src/core/x402-receipts.js +303 -0
- package/src/index.js +19 -0
- package/src/mcp/proxy.js +493 -0
- package/src/mcp/server.js +226 -0
- package/src/report/format.js +53 -0
- package/src/report/sarif.js +50 -0
- package/src/scanner/rules.js +185 -0
- package/src/scanner/scan.js +118 -0
- package/src/ui/server.js +346 -0
- package/src/ui/static/app.js +210 -0
- package/src/ui/static/index.html +342 -0
- package/src/ui/static/styles.css +904 -0
- package/src/version.js +2 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 thewaltero
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="assets/banner.png" alt="Mythos Sentinel banner" width="864" />
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
# Mythos Sentinel
|
|
6
|
+
|
|
7
|
+
**Local-first runtime firewall for wallet-enabled AI agents, MCP tools, and x402/Base payments.**
|
|
8
|
+
|
|
9
|
+
Agents are starting to discover paid APIs and pay over HTTP. Sentinel sits before those payments and answers the question raw wallets and discovery layers do not fully answer:
|
|
10
|
+
|
|
11
|
+
> Should this agent be allowed to spend this amount on this endpoint right now?
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
Agent / MCP client / wallet-enabled workflow
|
|
15
|
+
↓
|
|
16
|
+
Mythos Sentinel
|
|
17
|
+
↓
|
|
18
|
+
policy · budget · unknown-domain rules · RouteScore signal
|
|
19
|
+
↓
|
|
20
|
+
allow · approval_required · block · receipt
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Why Sentinel?
|
|
24
|
+
|
|
25
|
+
| Tool type | What it does | What Sentinel adds |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| Agent frameworks | Run tasks and call tools | Spend/control layer before risky actions |
|
|
28
|
+
| MCP clients | Connect agents to tools | Runtime proxy and policy enforcement |
|
|
29
|
+
| x402 APIs | Let agents pay services | Budget, trust, receipts, and fallback routing |
|
|
30
|
+
| Wallet permissions | Limit raw spend | Context-aware allow / approval / block decisions |
|
|
31
|
+
| API marketplaces | Help agents discover services | Local reliability scoring and routing decisions |
|
|
32
|
+
|
|
33
|
+
## Why this exists
|
|
34
|
+
|
|
35
|
+
x402/Bazaar-style discovery makes it easier for agents to find and pay APIs. That creates a new problem: agents can spend quickly, but they still need budgets, trust signals, logs, and approval rules.
|
|
36
|
+
|
|
37
|
+
Sentinel is the local control layer around that behavior:
|
|
38
|
+
|
|
39
|
+
- Can this agent spend on this domain?
|
|
40
|
+
- Is this amount safe for an unknown API?
|
|
41
|
+
- Does RouteScore say this endpoint is reliable enough?
|
|
42
|
+
- Did the action produce an audit trail?
|
|
43
|
+
- Should the human approve before payment?
|
|
44
|
+
|
|
45
|
+
## Core features
|
|
46
|
+
|
|
47
|
+
| Feature | What it does |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| Adaptive x402/Base spend guard | Enforces trusted, known, unknown, denied, budget, and RouteScore-based decisions. |
|
|
50
|
+
| RouteScore catalog + routing | Scores seed, custom, and Bazaar-imported paid agent APIs, then recommends selected services and fallback routes. |
|
|
51
|
+
| Fallback routing primitives | Plans and executes fallback attempts through caller-provided executors so agents can retry safer alternatives when a provider fails. |
|
|
52
|
+
| x402 receipt ingestion | Normalizes sanitized x402 payment receipts, tracks settlement status, and summarizes observed spend without storing prompts or responses. |
|
|
53
|
+
| Opt-in local telemetry | Stores sanitized local endpoint events only after the user enables it. No prompts, responses, secrets, private files, or wallet balances. |
|
|
54
|
+
| Passive reliability scoring | Uses proxied-call success/failure, latency, schema, and price-match signals to improve RouteScore locally. |
|
|
55
|
+
| Runtime MCP proxy | Puts Sentinel in front of upstream MCP tools so risky calls cannot bypass policy. |
|
|
56
|
+
| Scanner and guards | Finds risky instructions and checks command, file, network, and payment actions before execution. |
|
|
57
|
+
| Receipts | Captures before/after workspace hashes and verifies agent work. |
|
|
58
|
+
| Local dashboard | A premium local control room for policy, RouteScore, telemetry, receipts, and guard tests. |
|
|
59
|
+
| GitHub Action | Runs Sentinel in CI without model keys, wallet keys, or hosted accounts. |
|
|
60
|
+
|
|
61
|
+
## Install
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm install -g mythos-sentinel
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Or run directly:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npx mythos-sentinel help
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Node.js 20+ is required. Sentinel does **not** require OpenAI, Anthropic, Coinbase, wallet, or private-key access.
|
|
74
|
+
|
|
75
|
+
## Runtime MCP proxy
|
|
76
|
+
|
|
77
|
+
Direct MCP mode gives agents Sentinel tools to ask for permission. Runtime proxy mode puts Sentinel in front of upstream MCP servers so risky calls cannot bypass policy.
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
mythos-sentinel proxy
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Flow:
|
|
84
|
+
|
|
85
|
+
```txt
|
|
86
|
+
Agent -> Mythos Sentinel Proxy -> upstream MCP tools / x402 APIs
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Use this mode for wallet-enabled agents, paid x402 APIs, shell tools, file tools, browser tools, and demos that need real enforcement. See `docs/RUNTIME_MCP_PROXY.md`.
|
|
90
|
+
|
|
91
|
+
## Quick start
|
|
92
|
+
|
|
93
|
+
Inside the project you want to protect:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
mythos-sentinel init --base
|
|
97
|
+
mythos-sentinel scan .
|
|
98
|
+
mythos-sentinel ui
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Check actions before an agent does them:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
mythos-sentinel check-command -- "npm install unknown-package"
|
|
105
|
+
mythos-sentinel check-file --path .env --operation read
|
|
106
|
+
mythos-sentinel check-network --domain api.github.com
|
|
107
|
+
mythos-sentinel check-payment --domain api.exa.ai --amount 0.01
|
|
108
|
+
mythos-sentinel check-payment --domain fresh-api.example --amount 0.01
|
|
109
|
+
mythos-sentinel check-payment --domain fresh-api.example --amount 0.10
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
List, import, recommend, and route x402 services:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
mythos-sentinel routescore categories
|
|
116
|
+
mythos-sentinel routescore list
|
|
117
|
+
mythos-sentinel routescore import services.yml
|
|
118
|
+
mythos-sentinel routescore sync-bazaar --query web_search --limit 20
|
|
119
|
+
mythos-sentinel routescore recommend --category web_search --max-price 0.05
|
|
120
|
+
mythos-sentinel routescore route --category web_search --max-price 0.05
|
|
121
|
+
mythos-sentinel routescore fallback --category web_search --max-price 0.05 --simulate-fail primary
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Enable local telemetry and inspect receipt summaries:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
mythos-sentinel telemetry enable
|
|
128
|
+
mythos-sentinel telemetry status
|
|
129
|
+
mythos-sentinel telemetry summary
|
|
130
|
+
mythos-sentinel x402-receipt summary
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Adaptive payment policy
|
|
134
|
+
|
|
135
|
+
Default behavior is balanced: agents can explore, but not with unlimited wallet freedom.
|
|
136
|
+
|
|
137
|
+
```json
|
|
138
|
+
{
|
|
139
|
+
"payments": {
|
|
140
|
+
"x402": {
|
|
141
|
+
"enabled": true,
|
|
142
|
+
"strategy": "balanced",
|
|
143
|
+
"maxPerRequestUSDC": 0.25,
|
|
144
|
+
"maxDailyUSDC": 5,
|
|
145
|
+
"requireApprovalAboveUSDC": 0.25,
|
|
146
|
+
"trustedDomains": ["api.coinbase.com", "api.developer.coinbase.com", "api.exa.ai"],
|
|
147
|
+
"deniedDomains": [],
|
|
148
|
+
"unknown": {
|
|
149
|
+
"allowTrial": true,
|
|
150
|
+
"maxPerRequestUSDC": 0.02,
|
|
151
|
+
"maxDailyUSDC": 0.25,
|
|
152
|
+
"requireApprovalAboveUSDC": 0.02
|
|
153
|
+
},
|
|
154
|
+
"routeScore": {
|
|
155
|
+
"autoAllowMinScore": 80,
|
|
156
|
+
"requireApprovalBelowScore": 60,
|
|
157
|
+
"blockBelowScore": 35
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Decision model:
|
|
165
|
+
|
|
166
|
+
```text
|
|
167
|
+
trusted domain + under budget -> allow
|
|
168
|
+
known service + high RouteScore -> allow
|
|
169
|
+
unknown domain + tiny amount -> allow trial
|
|
170
|
+
unknown domain + larger amount -> approval_required
|
|
171
|
+
low RouteScore / denied / over budget -> block
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
This avoids the bad tradeoff of either blocking every new API or letting agents freely spend on anything.
|
|
175
|
+
|
|
176
|
+
## RouteScore and fallback routing
|
|
177
|
+
|
|
178
|
+
RouteScore is **not** a fake global oracle. It starts with a seed catalog, can import live/custom services, and becomes more valuable when agents route calls through Sentinel and opt into local telemetry.
|
|
179
|
+
|
|
180
|
+
Data layers:
|
|
181
|
+
|
|
182
|
+
1. **Seed metadata** — starter category/domain/endpoint/rough-price metadata.
|
|
183
|
+
2. **Custom local services** — user-imported `services.yml` / JSON.
|
|
184
|
+
3. **Optional Bazaar metadata** — live public discovery metadata synced into local storage.
|
|
185
|
+
4. **Local telemetry** — opt-in success/failure/latency/price-match observations.
|
|
186
|
+
5. **x402 receipts** — sanitized local payment/settlement records.
|
|
187
|
+
|
|
188
|
+
Commands:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
mythos-sentinel routescore categories
|
|
192
|
+
mythos-sentinel routescore list --json
|
|
193
|
+
mythos-sentinel routescore import services.yml
|
|
194
|
+
mythos-sentinel routescore sync-bazaar --query content_extraction --limit 20
|
|
195
|
+
mythos-sentinel routescore recommend --category content_extraction --max-price 0.05 --json
|
|
196
|
+
mythos-sentinel routescore route --category content_extraction --max-price 0.05 --json
|
|
197
|
+
mythos-sentinel routescore fallback --category content_extraction --max-price 0.05 --simulate-fail primary
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Custom service catalog example:
|
|
201
|
+
|
|
202
|
+
```yaml
|
|
203
|
+
services:
|
|
204
|
+
- name: Custom Search API
|
|
205
|
+
category: web_search
|
|
206
|
+
domain: api.example.com
|
|
207
|
+
endpoint: https://api.example.com/search
|
|
208
|
+
priceUSDC: 0.01
|
|
209
|
+
network: base
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
See `docs/ROUTESCORE.md`, `docs/FALLBACK_ROUTING.md`, and `docs/BAZAAR_ADAPTER.md`.
|
|
213
|
+
|
|
214
|
+
## Opt-in telemetry and x402 receipts
|
|
215
|
+
|
|
216
|
+
Telemetry is disabled until the user enables it. It stores sanitized endpoint metadata only and never stores prompts, responses, secrets, private files, private keys, or wallet balances.
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
mythos-sentinel telemetry enable
|
|
220
|
+
mythos-sentinel telemetry status
|
|
221
|
+
mythos-sentinel telemetry summary
|
|
222
|
+
mythos-sentinel telemetry events --json
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
x402 receipt ingestion stores sanitized payment proof locally and can feed RouteScore telemetry when telemetry is enabled.
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
mythos-sentinel x402-receipt ingest --file receipt.json
|
|
229
|
+
mythos-sentinel x402-receipt summary
|
|
230
|
+
mythos-sentinel x402-receipt list --json
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
See `docs/TELEMETRY.md`, `docs/PASSIVE_SCORING.md`, and `docs/X402_RECEIPTS.md`.
|
|
234
|
+
|
|
235
|
+
## Local dashboard
|
|
236
|
+
|
|
237
|
+
Run:
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
mythos-sentinel ui
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
For GitHub Codespaces demos:
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
mythos-sentinel ui --host 0.0.0.0 --port 4317 --demo
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
The dashboard is local-first. It does not upload repos, secrets, wallet keys, prompts, responses, telemetry, or reports to a hosted Mythos service.
|
|
250
|
+
|
|
251
|
+
## MCP usage
|
|
252
|
+
|
|
253
|
+
Run the MCP-style server:
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
mythos-sentinel mcp
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Example Cursor/Claude MCP config:
|
|
260
|
+
|
|
261
|
+
```json
|
|
262
|
+
{
|
|
263
|
+
"mcpServers": {
|
|
264
|
+
"mythos-sentinel": {
|
|
265
|
+
"command": "npx",
|
|
266
|
+
"args": ["mythos-sentinel", "mcp"]
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Exposed tools:
|
|
273
|
+
|
|
274
|
+
- `sentinel_scan_path`
|
|
275
|
+
- `sentinel_check_x402_payment`
|
|
276
|
+
- `sentinel_recommend_x402_service`
|
|
277
|
+
- `sentinel_route_x402_service`
|
|
278
|
+
- `sentinel_list_service_categories`
|
|
279
|
+
- `sentinel_parse_x402_receipt`
|
|
280
|
+
- `sentinel_score_x402_domain`
|
|
281
|
+
- `sentinel_check_command`
|
|
282
|
+
- `sentinel_check_file`
|
|
283
|
+
- `sentinel_check_network`
|
|
284
|
+
- `sentinel_snapshot`
|
|
285
|
+
|
|
286
|
+
## Scanner demo
|
|
287
|
+
|
|
288
|
+
Sentinel detects secrets, risky shell installers, sensitive files, network calls, and policy violations before agent work is trusted.
|
|
289
|
+
|
|
290
|
+
## Receipts
|
|
291
|
+
|
|
292
|
+
Create an agent work receipt:
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
mythos-sentinel snapshot . --out .mythos/snapshots/before.json
|
|
296
|
+
# Let Codex/Cursor/Claude/your agent work here.
|
|
297
|
+
mythos-sentinel scan . --out .mythos/reports/sentinel-report.json
|
|
298
|
+
mythos-sentinel receipt \
|
|
299
|
+
--before .mythos/snapshots/before.json \
|
|
300
|
+
--summary "Implemented feature safely" \
|
|
301
|
+
--agent codex \
|
|
302
|
+
--provider openai \
|
|
303
|
+
--tool codex-cli \
|
|
304
|
+
--out mythos-receipt.json
|
|
305
|
+
mythos-sentinel verify --receipt mythos-receipt.json
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
## CLI commands
|
|
309
|
+
|
|
310
|
+
```text
|
|
311
|
+
mythos-sentinel init [--base] [--force]
|
|
312
|
+
mythos-sentinel scan [path] [--json] [--sarif] [--out report.json] [--fail-on high|critical|none]
|
|
313
|
+
mythos-sentinel check-payment --domain api.example.com --amount 0.05 [--daily-spent 1.2] [--route-score 91]
|
|
314
|
+
mythos-sentinel check-command -- "shell command"
|
|
315
|
+
mythos-sentinel check-file --path .env --operation read|write
|
|
316
|
+
mythos-sentinel check-network --domain api.example.com
|
|
317
|
+
mythos-sentinel routescore list|categories|recommend|route|fallback [--category web_search] [--max-price 0.05]
|
|
318
|
+
mythos-sentinel routescore import services.yml
|
|
319
|
+
mythos-sentinel routescore sync-bazaar [--query web_search] [--limit 20]
|
|
320
|
+
mythos-sentinel routescore search-bazaar --query browser --limit 10
|
|
321
|
+
mythos-sentinel telemetry status|enable|disable|summary|events
|
|
322
|
+
mythos-sentinel x402-receipt ingest --file receipt.json
|
|
323
|
+
mythos-sentinel x402-receipt summary
|
|
324
|
+
mythos-sentinel x402-receipt list
|
|
325
|
+
mythos-sentinel snapshot [path] --out before.json
|
|
326
|
+
mythos-sentinel receipt --before before.json --summary "task" --agent codex
|
|
327
|
+
mythos-sentinel verify --receipt mythos-receipt.json
|
|
328
|
+
mythos-sentinel mcp
|
|
329
|
+
mythos-sentinel proxy [--policy mythos.policy.json] [--config proxy.json]
|
|
330
|
+
mythos-sentinel ui [--host 127.0.0.1] [--port 4317] [--open] [--demo]
|
|
331
|
+
mythos-sentinel doctor
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
## Security model
|
|
335
|
+
|
|
336
|
+
Sentinel is a policy decision engine and scanner. It is **not** a sandbox, wallet, transaction signer, or guarantee of API quality. It works when agents route risky actions through Sentinel before execution/payment.
|
|
337
|
+
|
|
338
|
+
For real funds, use least-privilege agent wallets, low spend permissions, testnet rehearsals, separate API credentials, hardware wallets for high-value assets, and human approval for large payments.
|
|
339
|
+
|
|
340
|
+
## Roadmap
|
|
341
|
+
|
|
342
|
+
- [x] Static agent/skill/MCP/repo scanner
|
|
343
|
+
- [x] command, file, network, and x402/Base guards
|
|
344
|
+
- [x] adaptive unknown-domain trial policy
|
|
345
|
+
- [x] RouteScore seed catalog and recommendation API
|
|
346
|
+
- [x] MCP RouteScore tools
|
|
347
|
+
- [x] premium local dashboard
|
|
348
|
+
- [x] GitHub Action and optional SARIF workflow
|
|
349
|
+
- [x] snapshot and agent work receipts
|
|
350
|
+
- [x] runtime MCP proxy mode
|
|
351
|
+
- [x] opt-in local telemetry store
|
|
352
|
+
- [x] passive routed-call reliability scoring
|
|
353
|
+
- [x] live Bazaar catalog adapter
|
|
354
|
+
- [x] fallback route planning and execution primitives
|
|
355
|
+
- [x] expanded service categories
|
|
356
|
+
- [x] x402 payment receipt ingestion
|
|
357
|
+
- [ ] signed provider badges
|
|
358
|
+
- [ ] optional shared reliability network
|
|
359
|
+
|
|
360
|
+
## License
|
|
361
|
+
|
|
362
|
+
MIT
|
package/action.yml
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: Mythos Sentinel
|
|
2
|
+
|
|
3
|
+
description: Scan agent skills, MCP tools, repo instructions, and x402/Base payment code.
|
|
4
|
+
|
|
5
|
+
author: thewaltero
|
|
6
|
+
|
|
7
|
+
inputs:
|
|
8
|
+
path:
|
|
9
|
+
description: Path to scan
|
|
10
|
+
required: false
|
|
11
|
+
default: .
|
|
12
|
+
policy:
|
|
13
|
+
description: Path to mythos.policy.json
|
|
14
|
+
required: false
|
|
15
|
+
default: mythos.policy.json
|
|
16
|
+
format:
|
|
17
|
+
description: text, json, or sarif
|
|
18
|
+
required: false
|
|
19
|
+
default: text
|
|
20
|
+
out:
|
|
21
|
+
description: Optional output file
|
|
22
|
+
required: false
|
|
23
|
+
default: ''
|
|
24
|
+
fail-on:
|
|
25
|
+
description: Severity threshold to fail on. Use none to never fail.
|
|
26
|
+
required: false
|
|
27
|
+
default: high
|
|
28
|
+
|
|
29
|
+
runs:
|
|
30
|
+
using: composite
|
|
31
|
+
steps:
|
|
32
|
+
- name: Run Mythos Sentinel
|
|
33
|
+
shell: bash
|
|
34
|
+
run: |
|
|
35
|
+
FLAGS=""
|
|
36
|
+
if [ "${{ inputs.format }}" = "json" ]; then FLAGS="$FLAGS --json"; fi
|
|
37
|
+
if [ "${{ inputs.format }}" = "sarif" ]; then FLAGS="$FLAGS --sarif"; fi
|
|
38
|
+
if [ -n "${{ inputs.out }}" ]; then FLAGS="$FLAGS --out ${{ inputs.out }}"; fi
|
|
39
|
+
node "${{ github.action_path }}/bin/mythos-sentinel.js" scan "${{ inputs.path }}" --policy "${{ inputs.policy }}" --fail-on "${{ inputs.fail-on }}" $FLAGS
|
|
40
|
+
|
|
41
|
+
branding:
|
|
42
|
+
icon: shield
|
|
43
|
+
color: purple
|
|
Binary file
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { runCli } from '../src/cli.js';
|
|
3
|
+
|
|
4
|
+
runCli(process.argv.slice(2)).catch((error) => {
|
|
5
|
+
console.error(`\nmythos-sentinel failed: ${error?.message || error}`);
|
|
6
|
+
if (process.env.MYTHOS_DEBUG) console.error(error?.stack || error);
|
|
7
|
+
process.exit(1);
|
|
8
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Architecture
|
|
2
|
+
|
|
3
|
+
Mythos Sentinel is intentionally dependency-light, local-first, and CLI/MCP-first.
|
|
4
|
+
|
|
5
|
+
## Layers
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
CLI / MCP tools / Runtime MCP proxy / GitHub Action / Dashboard
|
|
9
|
+
↓
|
|
10
|
+
policy engine
|
|
11
|
+
↓
|
|
12
|
+
scanner · guards · RouteScore · telemetry · x402 receipts · snapshots
|
|
13
|
+
↓
|
|
14
|
+
JSON reports · SARIF · local receipts · local reliability signals
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Modules
|
|
18
|
+
|
|
19
|
+
- `src/cli.js` — command surface for scan, guard checks, RouteScore, telemetry, x402 receipts, MCP, proxy, and dashboard.
|
|
20
|
+
- `src/scanner` — static rules for agent skills, MCP configs, repo instructions, CI files, wallet/payment code, and unsafe commands.
|
|
21
|
+
- `src/core/policy.js` — policy loading and command/file/network/payment guard decisions.
|
|
22
|
+
- `src/core/routescore.js` — seed/custom/Bazaar service catalog, scoring, category aliases, route plans, and fallback execution primitives.
|
|
23
|
+
- `src/core/telemetry.js` — opt-in local telemetry store and passive reliability summaries.
|
|
24
|
+
- `src/core/x402-receipts.js` — sanitized x402 receipt ingestion, local receipt store, and spend summaries.
|
|
25
|
+
- `src/core/snapshot.js` — file hash snapshots and diffs.
|
|
26
|
+
- `src/core/receipt.js` — task receipts and drift verification.
|
|
27
|
+
- `src/mcp/server.js` — local JSON-RPC/MCP-style tool surface.
|
|
28
|
+
- `src/mcp/proxy.js` — runtime proxy that gates upstream MCP tools before forwarding calls.
|
|
29
|
+
- `src/ui/server.js` and `src/ui/static` — local dashboard and API endpoints.
|
|
30
|
+
- `src/report` — human, JSON, and SARIF outputs.
|
|
31
|
+
|
|
32
|
+
## Local storage
|
|
33
|
+
|
|
34
|
+
Runtime state is stored under `.mythos/`:
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
.mythos/routescore/services.json # imported/synced service catalog
|
|
38
|
+
.mythos/telemetry/events.jsonl # opt-in local endpoint telemetry
|
|
39
|
+
.mythos/x402/receipts.jsonl # sanitized x402 receipt records
|
|
40
|
+
.mythos/reports/ # generated scan reports
|
|
41
|
+
.mythos/snapshots/ # generated file snapshots
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Generated runtime files should not be committed unless intentionally shared.
|
|
45
|
+
|
|
46
|
+
## Non-goals
|
|
47
|
+
|
|
48
|
+
- Not a sandbox.
|
|
49
|
+
- Not a wallet or transaction signer.
|
|
50
|
+
- Not a formal verifier.
|
|
51
|
+
- Not a remote SaaS scanner.
|
|
52
|
+
- Not a guarantee of endpoint quality or settlement success.
|
|
53
|
+
- Not another coding agent.
|
|
54
|
+
|
|
55
|
+
Sentinel should stay a small, auditable permission, routing, and spend-control layer around agents.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Base / x402 Positioning
|
|
2
|
+
|
|
3
|
+
Mythos Sentinel is built for agents that can discover paid services and pay over x402/Base.
|
|
4
|
+
|
|
5
|
+
The product should be positioned as:
|
|
6
|
+
|
|
7
|
+
> Adaptive spend firewall and RouteScore reliability layer for wallet-enabled agents.
|
|
8
|
+
|
|
9
|
+
Not as:
|
|
10
|
+
|
|
11
|
+
- a wallet
|
|
12
|
+
- a transaction signer
|
|
13
|
+
- a generic MCP scanner only
|
|
14
|
+
- a fake API marketplace
|
|
15
|
+
- a guarantee of endpoint quality
|
|
16
|
+
|
|
17
|
+
## Correct flow
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
Agent discovers paid API
|
|
21
|
+
↓
|
|
22
|
+
RouteScore recommends/checks reliability
|
|
23
|
+
↓
|
|
24
|
+
Sentinel checks policy, budget, trust, and score
|
|
25
|
+
↓
|
|
26
|
+
allow / approval_required / block
|
|
27
|
+
↓
|
|
28
|
+
payment tool or wallet executes only if allowed
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Why this is useful
|
|
32
|
+
|
|
33
|
+
x402 reduces friction for paid APIs. That makes the next problem obvious: agents need spend limits, endpoint trust, routing context, and receipts. Sentinel focuses on that runtime gap.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Bazaar Adapter
|
|
2
|
+
|
|
3
|
+
Mythos Sentinel v0.10 can import x402 service metadata from CDP Bazaar discovery endpoints into the local RouteScore catalog.
|
|
4
|
+
|
|
5
|
+
## Why it exists
|
|
6
|
+
|
|
7
|
+
The seed RouteScore catalog is intentionally small. The Bazaar adapter lets Sentinel expand from a few seed services into a live/local catalog without manually hardcoding every endpoint.
|
|
8
|
+
|
|
9
|
+
## Commands
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
mythos-sentinel routescore sync-bazaar --limit 100
|
|
13
|
+
mythos-sentinel routescore sync-bazaar --query web_search --limit 20
|
|
14
|
+
mythos-sentinel routescore search-bazaar --query browser --limit 10
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Synced services are normalized and stored in:
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
.mythos/routescore/services.json
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## What is normalized
|
|
24
|
+
|
|
25
|
+
- `resource` / endpoint URL
|
|
26
|
+
- domain
|
|
27
|
+
- inferred category
|
|
28
|
+
- network
|
|
29
|
+
- rough USDC price when payment metadata exposes an amount
|
|
30
|
+
- metadata description
|
|
31
|
+
- input/output schema presence
|
|
32
|
+
- payment metadata presence
|
|
33
|
+
- last updated timestamp
|
|
34
|
+
|
|
35
|
+
## Privacy
|
|
36
|
+
|
|
37
|
+
The adapter fetches public catalog metadata only. It does not send prompts, responses, wallet keys, private files, or telemetry to Mythos.
|
|
38
|
+
|
|
39
|
+
## Reliability model
|
|
40
|
+
|
|
41
|
+
Bazaar metadata expands discovery. Passive telemetry and RouteScore scoring still decide whether a service is preferred, limited, trial-only, or avoided.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Dashboard
|
|
2
|
+
|
|
3
|
+
Run:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
mythos-sentinel ui
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The dashboard is a local control room for:
|
|
10
|
+
|
|
11
|
+
- adaptive x402/Base spend policy;
|
|
12
|
+
- trusted and unknown-domain payment rules;
|
|
13
|
+
- RouteScore seed/custom/Bazaar-imported catalog data;
|
|
14
|
+
- fallback route plans;
|
|
15
|
+
- opt-in local telemetry and passive samples;
|
|
16
|
+
- x402 receipt summaries;
|
|
17
|
+
- payment, command, file, and scan checks;
|
|
18
|
+
- MCP and agent setup snippets.
|
|
19
|
+
|
|
20
|
+
The visual direction is intentionally dark, minimal, and developer-infra focused: graphite background, restrained amber accents, compact metrics, and clear guard decisions.
|
|
21
|
+
|
|
22
|
+
No hosted account is required. The dashboard does not upload prompts, responses, repos, secrets, wallet keys, telemetry, receipts, or reports to a hosted Mythos service.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Fallback routing
|
|
2
|
+
|
|
3
|
+
RouteScore can now produce and execute ordered fallback plans. This prevents an agent from depending on a single paid API when multiple acceptable services exist.
|
|
4
|
+
|
|
5
|
+
## CLI route plan
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
mythos-sentinel routescore route --category web_search --max-price 0.05
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The plan includes:
|
|
12
|
+
|
|
13
|
+
1. selected service
|
|
14
|
+
2. fallback services
|
|
15
|
+
3. RouteScore and price
|
|
16
|
+
4. Sentinel payment-policy decisions
|
|
17
|
+
|
|
18
|
+
## CLI fallback simulation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
mythos-sentinel routescore fallback --category web_search --max-price 0.05 --simulate-fail primary
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
This does not call paid APIs. It demonstrates the attempt order and fallback behavior using a simulated executor.
|
|
25
|
+
|
|
26
|
+
## SDK primitive
|
|
27
|
+
|
|
28
|
+
`executeFallbackRoute` accepts a route plan and a caller-provided executor:
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
const result = await executeFallbackRoute({
|
|
32
|
+
plan,
|
|
33
|
+
executor: async (service) => callProvider(service.endpoint)
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Sentinel does not hide spending logic inside fallback routing. Integrations remain responsible for payment/signing flows, while Sentinel supplies route order, policy checks, and telemetry hooks.
|