The Contract Layer for Safe AI Agent Execution
AI Agent 安全执行的合同层
Large language models generate probabilistically. Production systems need deterministic boundaries. Schema Sandbox defines a layered neuro-symbolic methodology to validate, authorize, isolate, and audit AI actions before they reach enterprise or industrial runtimes.
大语言模型是概率性生成的。生产环境系统在 Agent 调用工具、读写文件、访问 API 之前,需要确定性的边界。Schema Sandbox 定义了一个分层的 neuro-symbolic 方法论,在模型输出到达企业或工业运行时之前进行验证、授权、隔离和审计。
Nine-Layer Agent Execution Flow
九层 Agent 执行流程
Schema Sandbox sits between raw LLM outputs and persistent enterprise runtimes. Below is the simplified execution flow representing the core boundary gates.
Schema Sandbox 介于原始 LLM 输出与持久化企业运行时之间。以下是核心边界网关的简化执行流程。
1. Capability Boundary
1. 能力边界
Defines what an agent is allowed to generate. Enforces strict input contracts, structured tool call grammars, and validation of outputs against formatting or semantic rules.
定义允许 Agent 生成的内容。强制执行严格的输入合同、结构化工具调用语法,并根据格式或语义规则校验输出。
2. Execution Boundary
2. 执行边界
Limits how actions are physically run. Enforces isolated workspace partitions, strict local filesystem boundaries, network access scopes, and conditional human approval escalations.
限制动作的物理运行方式。强制执行隔离的工作区分区、严格的本地文件系统边界、网络访问范围以及条件性人工审批升级。
3. Evidence Boundary
3. 证据边界
Ensures high traceability. Records input/output hashes, exact tool arguments, permission validation results, trace metadata, and tamper-proof evidence logs.
确保高度可追溯性。记录输入/输出哈希、精确的工具参数、权限校验结果、追踪元数据以及防篡改的证据日志。
Industrial Middleware Reference Patterns
工业级 AI 中间件参考模式
AI agents should not directly connect to operational systems. We present five reference middleware patterns showing how Schema Sandbox isolates and validates actions.
AI Agent 不应直接连接到生产系统。我们展示了五种参考中间件模式,以演示 Schema Sandbox 如何隔离和校验动作。
Industrial Maintenance Work Order Gateway
设备维护工单网关
AI drafts work orders, but cannot bypass permission gates or submit high-risk actions without review. AI 可以草拟维护工单,但不能绕过权限边界或在未经人工审批下提交高风险操作。The Problem
面临问题
Enforced Contracts
强制执行合同
- Input validation: Validates alarm code and machine identifiers.
- Permission scope: Read machine status, create draft work-orders only.
- Output validation: Ensure structured work order payload matches enterprise schemas.
- Human sign-off routing: High-priority alarms force decision redirection.
- 输入校验:验证警报代码和设备标识符。
- 权限范围:读取设备状态,仅限创建工单草稿。
- 输出校验:确保生成的工单数据符合企业系统 Schema 规范。
- 人工审批路由:高优先级警报将强制重定向决策至人工审批。
{
"decision": "ask",
"reason": "high_priority_work_order_requires_human_approval",
"evidence_id": "ev_maintenance_001"
}
Quality Inspection Report Contract
质量检测报告合同
AI generates inspection reports, but must satisfy field validation and forbidden-claim constraints. AI 可以生成质检报告,但必须满足字段、数据证据和禁用词约束。The Problem
面临问题
Enforced Contracts
强制执行合同
- Required fields: Batch ID, inspector key, raw value, tolerance limits.
- Forbidden patterns: Denies marketing-speak like "100% compliant" or "guaranteed defect-free".
- Evidence binding: Forces cryptographic signature matching of input test records.
- 必要字段:批次 ID、质检员密钥、原始测量值、容差范围。
- 禁用模式:禁止使用“100%合格”或“保证无缺陷”等营销辞令,除非有真实检测数据支撑。
- 证据绑定:强制对输入测试记录进行加密数字签名包装。
{
"decision": "reject",
"reason": "forbidden_pattern_matched",
"detail": {
"field": "conclusion",
"value": "This batch is 100% compliant and guaranteed safe."
}
}
ERP / MES Permission Gateway
ERP / MES 查询网关
No direct database connections. AI queries pass through schema permission layers and field filters. 禁止直接连接数据库。所有的 AI 查询都必须经过 Schema 权限层和字段过滤。The Problem
面临问题
Enforced Contracts
强制执行合同
- Role-aware scope: Maps agent session key to specific tables and query actions.
- Field-level sanitization: Automatically strips or hashes sensitive fields.
- Deny-by-default: Rejects any ambiguous or multi-join operations.
- 角色感知范围:将 Agent 会话密钥映射到特定的表和查询动作。
- 字段级脱敏:自动剥离或哈希敏感字段。
- 默认拒绝:拒绝任何模糊的或包含多表关联的操作。
{
"decision": "reject",
"reason": "scope_violation",
"detail": {
"proposed_action": "ERP.readPayrollData",
"error": "action_outside_allowed_tool_scope"
}
}
Supplier Document Intake
供应商文档录入
AI parses supplier documents, but only validated, structured records enter enterprise systems. AI 可以从非结构化文档中提取供应商信息,但只有经过校验的字段才能写入业务系统。The Problem
面临问题
Enforced Contracts
强制执行合同
- Required structures: Supplier name, registry code, tax identifier, currency.
- Schema checking: Enforces ISO country boundaries and correct postal formats.
- Fallback logic: Auto-sends missing field complaints back to the supplier.
- 必需结构:供应商名称、注册码、税号、货币类型。
- Schema 检查:强制执行 ISO 国家代码边界和正确的邮编格式。
- 回退逻辑:自动将缺失字段的申诉意见发送回供应商。
{
"decision": "reject",
"reason": "missing_required_fields",
"detail": {
"missing": [
"registration_number"
],
"action": "provide_fallback_or_ask_supplier"
}
}
EHS Compliance Assistant
EHS 安全合规助手
AI drafts EHS incident responses, but critical safety classifications require human verification. AI 可以起草 EHS 事故纠正措施,但关键的安全分类和建议需要明确的人工审核。The Problem
面临问题
Enforced Contracts
强制执行合同
- Input provenance check: Ensures report inputs originate from verified sensors.
- Safety keyword triggers: Red-flags sentences requesting immediate containment.
- Verification logs: Collects evidence files showing human confirmation of safety codes.
- 数据源验证:确保报告输入来自于通过验证的传感器。
- 安全词触发:红色警示任何包含紧急控制或泄露等敏感词的句子。
- 验证日志:收集记录了安全代码的人工确认凭证的证据文件。
{
"decision": "ask",
"reason": "high_risk_corrective_action_detected",
"detail": {
"trigger_field": "priority",
"trigger_value": "immediate_escalation_required"
}
}
Schema Interoperability Protocol (SIP-Core)
Schema 互操作协议 (SIP-Core)
SIP-Core is the minimal manifest spec designed to describe sandboxes as secure, discoverable capability assets.
SIP-Core 是最小清单规范,旨在将沙箱描述为安全、可发现的“能力资产”。
Input/Output Validation schemas
输入/输出校验 Schema
Describe JSON-Schema configurations that govern agent inputs and sanitization patterns.
描述控制 Agent 输入和脱敏规则的 JSON-Schema 配置。
Granular Permission Scopes
细粒度的权限范围
Locks local paths (`fs_scope`), restricts API hosts (`net_scope`), and defines allowed tool names (`tool_scope`).
锁定本地路径 (`fs_scope`),限制 API 主机 (`net_scope`),并限制允许的工具名称 (`tool_scope`)。
Traceable Rejection Payloads
可追溯的拒绝负载
Standard error formats returning `SIP_ERR_INPUT_VIOLATION` or `SIP_ERR_SCOPE_LOCKED` for fast self-healing prompts.
标准错误格式,向 Agent 返回冲突字段以实现自我修复(Self-healing Prompt)。
{
"sip_version": "0.1.0",
"sandbox_id": "industrial_maintenance_workorder",
"capability_type": "industrial.workorder.gateway",
"input_contract": {
"schema_ref": "./schemas/input.schema.json",
"sanitize_input": true
},
"permission_scope": {
"fs_scope": ["./workspace/reports"],
"net_scope": ["mes.example.com:443"],
"tool_scope": ["MES.readStatus", "MES.createWorkOrder"],
"human_approval": true
}
}
License & Citation Guide
开源许可与引用指南
Schema Sandbox is free for commercial and non-commercial application, provided that attribution rules are respected.
Schema Sandbox 免费向商业和非商业应用开放,但需严格遵守署名与引用规则。
Dual Open-Source License
双重开源许可证
The Schema Sandbox repository operates on a split license:
Schema Sandbox 仓库采用分层许可证结构:
- Content & Methodology: Licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
- Code & JSON Schemas: Provided under the Apache License 2.0.
- 内容与方法论:采用 Creative Commons Attribution 4.0 International (CC BY 4.0) 许可。
- 代码与 JSON Schema:采用 Apache 2.0 开源许可证。
Note: Trademark names "Schema Sandbox" and "SIP" are reserved. See TRADEMARK.md for guidelines.
注意:Schema Sandbox 和 SIP 等商标权保留。详见 TRADEMARK.md 准则。
Suggested Attribution
建议署名鸣谢
If you build, adapt, or teach using the Schema Sandbox methodology, please show this notice:
如果您基于 Schema Sandbox 进行二次开发、适配或教学,请展示此鸣谢声明:
For academic citations, download the BibTeX metadata from CITATION.cff.
学术引用请从 CITATION.cff 下载 BibTeX 元数据。
Subscribe to the Specification Updates
订阅协议演进动态
Sign up to receive draft revisions of the Schema Interoperability Protocol (SIP-Core), case studies, and safety updates. Join the registry of commercial adopters.
登记获取 Schema 互操作协议 (SIP-Core) 草案修订、案例研究与安全通告。欢迎加入商业采纳者目录。
Official Registry: Adopters who wish to be listed on our website showcase can open a GitHub issue.
官方登记处:希望被列入我们网站案例展示的采纳者,可直接在 GitHub 上 提交 Issue。