跳至主要內容
hs-sql-agent

Governance

把 authorization 留在模型之外。

每把 MCP key 都只暴露指定 database、tools、tables、rate limits 與 runtime policy;LLM 無法靠 prompt 重新定義這些邊界。

01

Per-key scope

Credential 綁定到實際 database 與允許的 MCP tools。

02

Table boundaries

Table allowlist 與 query policy 不受模型指令影響。

03

Operational limits

Rate limit、concurrency、revocation 與 audit 都在 prompt 之外執行。

Policy 應該存在 Server,而不是 Prompt

Prompt 不是 authorization system。hs-sql-agent 會先檢查 authenticated key、database binding、allowed tools、table boundary 與 runtime security policy,之後 SQL 才可能進入 execution。

每把 Key 只暴露必要能力

MCP key 可以只綁定 client 真正需要的 database 與 tools。Built-in tool 與已發布的 Custom Tool 在 invocation 前都會經過 key configuration 檢查。

  • database binding
  • allowed MCP tools
  • table whitelist
  • effective rate limits
  • revocation 與 expiry state

Execution boundary 必須可 Audit

Query 與 DML execution 會留下 tool、operation、timing、returned / affected rows、approval state 與 compiler-derived facts 等 audit context。模型互動結束後,治理仍然可以被檢查。