toby-bridges/api-relay-audit
toby-bridges/api-relay-audit从 DeepSeek Harness 对 AI API 中转站和 LLM 代理运行本地安全审计,生成 Markdown 报告,覆盖提示词注入、模型替换信号、工具调用改写、错误泄漏、流完整性和按 profile 启用的 Web3 风险。
面向 DeepSeek Harness 的 mcp__omni__parse 加固护栏:tools/pre-execute 监听器拒绝私网/保留主机(SSRF),施加白名单或 ask(同意),allowedRoots 为空时 fail-closed。
English · 中文
An optional DeepSeek Harness bundle that hardens the Omni Reader parse tool. It registers a tools/pre-execute listener that gates mcp__omni__parse so a model cannot silently parse an arbitrary URL. Install it after/alongside the @cueai/dsh-omni-reader wiring bundle.
Before a mcp__omni__parse call dispatches, the guard classifies the source:
source · outcome private / loopback / link-local / cloud-metadata host (10/8, 172.16/12, 192.168/16, 127/8, 169.254.169.254, 100.64/10, fe80::, fc00::, ::1, localhost, *.local, metadata…) · deny (SSRF guard) allow-listed host (allowList) · allow other external host · policyForUnknown — deny (default), ask, or allow local path inside an explicitly configured allowedRoots · allow local path outside allowedRoots, or no allowedRoots set · deny (fail-closed)
Every other tool passes through untouched (the guard keys on mcp__omni__parse). It gates the source argument and the url alias (Bridge 1.5+ accepts exactly one of the two).
dsh plugin --profile web add @cueai/dsh-omni-reader-guard
# or one-off
dsh web --patch ./dsh/cue-omni-reader-guard/cordis.patch.ymlVia the bundle's cordis.patch.yml config (no secrets, no hardcoded deployment paths):
Field · Type · Default · Meaning blockPrivate · boolean · true · deny private/reserved hosts (the SSRF gate) allowList · string[] · [] · hosts/domains that bypass consent (a bare domain also admits subdomains; *.x for subdomains only) allowedRoots · string[] · [] (local files denied) · absolute dirs a local source must fall under. Set explicitly to allow local parsing; empty = fail-closed policyForUnknown · 'deny'\ · 'ask'\ · 'allow' · 'deny' · outcome for an external host not in allowList consentReason · string · … · prompt text for policyForUnknown: ask
Example: allow a trusted API host and require consent elsewhere.
config:
blockPrivate: true
allowList: ['api.example.com']
policyForUnknown: asknode --test dsh/cue-omni-reader-guard/test/policy.test.js
python3 scripts/verify_dsh_bundles.pyask requires DSH's approval service to return allowed-once; without one itbecomes a denial (fail-closed) — see the tools/pre-execute waterfall contract.
rewrite arguments. Keep allowedRoots minimal and prefer deny + an explicit allowList for unattended agents.
policy.js) is pure Node (node:url/node:net), so thesecurity logic is testable without a live DSH.
MIT — see LICENSE.