ai-agent-book 精选快照(<2MB 代码与文档,来自 github.com/bojieli/ai-agent-book)
Build latest book artifacts / build (push) Canceled after 0s
dependency resolution / resolve (3.11) (push) Canceled after 0s
dependency resolution / resolve (3.13) (push) Canceled after 0s
deploy-pages / build (push) Canceled after 0s
deploy-pages / deploy (push) Canceled after 0s
i18n consistency check / check (push) Canceled after 0s
provider adoption tests / test (chapter2/context-compression) (push) Canceled after 0s
provider adoption tests / test (chapter2/prompt-injection) (push) Canceled after 0s
provider adoption tests / test (chapter2/system-hint) (push) Canceled after 0s
provider adoption tests / test (chapter3/log-sanitization) (push) Canceled after 0s
web-search-agent tests / test (push) Canceled after 0s
web-search-agent tests / agentbook (push) Canceled after 0s

This commit is contained in:
2026-08-20 13:12:50 +00:00
commit b119135836
10275 changed files with 3284984 additions and 0 deletions
@@ -0,0 +1,272 @@
{
"transport": "mcp-stdio",
"server_name": "execution-tools",
"server_version": "1.0.0",
"schemas": [
{
"name": "file_write",
"description": "Write content to a file with automatic syntax verification",
"inputSchema": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "File path (relative to workspace or absolute)"
},
"content": {
"type": "string",
"description": "Content to write"
},
"overwrite": {
"type": "boolean",
"description": "Whether to overwrite existing files",
"default": false
}
},
"required": [
"path",
"content"
]
}
},
{
"name": "file_edit",
"description": "Edit an existing file by searching and replacing content",
"inputSchema": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "File path"
},
"search": {
"type": "string",
"description": "Text to search for"
},
"replace": {
"type": "string",
"description": "Replacement text"
}
},
"required": [
"path",
"search",
"replace"
]
}
},
{
"name": "code_interpreter",
"description": "Execute code in multiple programming languages in a sandboxed environment with result analysis. Supports: Python, JavaScript, TypeScript, Go, Java, C++, Rust, PHP, Bash",
"inputSchema": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Code to execute"
},
"language": {
"type": "string",
"description": "Programming language (python, javascript, typescript, go, java, cpp, rust, php, bash)",
"default": "python"
},
"timeout": {
"type": "number",
"description": "Execution timeout in seconds",
"default": 30.0
},
"stdin": {
"type": "string",
"description": "Optional stdin input for the program"
},
"files": {
"type": "object",
"description": "Optional additional files (filename -> content mapping)",
"additionalProperties": {
"type": "string"
}
}
},
"required": [
"code"
]
}
},
{
"name": "virtual_terminal",
"description": "Execute shell commands with error summarization",
"inputSchema": {
"type": "object",
"properties": {
"command": {
"type": "string",
"description": "Shell command to execute"
},
"timeout": {
"type": "integer",
"description": "Timeout in seconds",
"default": 30
}
},
"required": [
"command"
]
}
},
{
"name": "google_calendar_add",
"description": "Add an event to Google Calendar",
"inputSchema": {
"type": "object",
"properties": {
"summary": {
"type": "string",
"description": "Event title"
},
"start_time": {
"type": "string",
"description": "Start time (ISO 8601 format, e.g., 2024-01-01T10:00:00)"
},
"end_time": {
"type": "string",
"description": "End time (ISO 8601 format)"
},
"description": {
"type": "string",
"description": "Event description"
},
"location": {
"type": "string",
"description": "Event location"
}
},
"required": [
"summary",
"start_time",
"end_time"
]
}
},
{
"name": "github_create_pr",
"description": "Create a GitHub Pull Request",
"inputSchema": {
"type": "object",
"properties": {
"repo_name": {
"type": "string",
"description": "Repository name (format: owner/repo)"
},
"title": {
"type": "string",
"description": "PR title"
},
"body": {
"type": "string",
"description": "PR description"
},
"head_branch": {
"type": "string",
"description": "Source branch"
},
"base_branch": {
"type": "string",
"description": "Target branch",
"default": "main"
}
},
"required": [
"repo_name",
"title",
"body",
"head_branch"
]
}
},
{
"name": "excel_create_with_formula_and_screenshot",
"description": "Create an XLSX workbook, apply formulas, and render a real screenshot with LibreOffice",
"inputSchema": {
"type": "object",
"properties": {
"output_path": {
"type": "string"
},
"rows": {
"type": "array",
"items": {
"type": "object",
"properties": {
"item": {
"type": "string"
},
"quantity": {
"type": "number"
},
"unit_price": {
"type": "number"
}
},
"required": [
"item",
"quantity",
"unit_price"
]
}
}
},
"required": [
"output_path",
"rows"
]
}
},
{
"name": "webhook_post",
"description": "POST JSON to a real HTTPS webhook endpoint",
"inputSchema": {
"type": "object",
"properties": {
"url": {
"type": "string"
},
"payload": {
"type": "object"
}
},
"required": [
"url",
"payload"
]
}
},
{
"name": "browser_navigate",
"description": "Navigate with real headless Chromium, extract page content, and save a screenshot",
"inputSchema": {
"type": "object",
"properties": {
"url": {
"type": "string"
},
"screenshot_path": {
"type": "string"
}
},
"required": [
"url",
"screenshot_path"
]
}
},
{
"name": "environment_capabilities",
"description": "Inspect real Computer Use container and Android device availability",
"inputSchema": {
"type": "object",
"properties": {}
}
}
],
"schema_sha256": "d9a5bd49b95a42874d0d588926f4c717df2344c86f22991624c3056720649e74"
}
@@ -0,0 +1,66 @@
[
{
"purpose": "dangerous_operation_review",
"called_at_utc": "2026-07-29T22:20:05.549577+00:00",
"provider": "kimi",
"request": {
"model": "kimi-k3",
"messages": [
{
"role": "system",
"content": "You are a cautious safety reviewer. Approve operations that are safe and reject risky ones."
},
{
"role": "user",
"content": "You are a safety reviewer for an AI agent execution system.\nReview the following operation and determine if it should be approved.\n\nOperation: terminal_command\nDetails: {\n \"command\": \"rm -rf ./should-never-execute\",\n \"detected_patterns\": [\n \"rm -rf\"\n ]\n}\n\nAnalyze the operation for:\n1. Potential data loss or destructive actions\n2. Security risks\n3. Resource consumption concerns\n4. Compliance with best practices\n\nRespond in JSON format:\n{\n \"approved\": true/false,\n \"reason\": \"Brief explanation of your decision\",\n \"risk_level\": \"low/medium/high\",\n \"recommendations\": [\"List of recommendations if any\"]\n}\n"
}
],
"temperature": 1,
"max_tokens": 4096
},
"response": {
"id": "chatcmpl-6a6a7c7da8472cac5b5dc12c",
"model": "kimi-k3",
"finish_reason": "stop",
"content": "```json\n{\n \"approved\": false,\n \"reason\": \"The command uses 'rm -rf', which performs irreversible recursive deletion without confirmation prompts. The target directory name 'should-never-execute' strongly signals this operation must not run. Additionally, the relative path means the deletion scope depends on the unknown current working directory, creating risk of unintended data loss.\",\n \"risk_level\": \"high\",\n \"recommendations\": [\n \"Reject this operation outright; the flagged 'rm -rf' pattern and directory naming indicate it should never execute\",\n \"If deletion of this path is ever legitimately required, first verify the working directory (pwd) and inspect contents (ls -la) before proceeding\",\n \"Replace destructive deletion with safer alternatives: move to a trash/quarantine directory, or use interactive deletion (rm -ri)\",\n \"Require explicit human confirmation for any operation matching recursive force-deletion patterns\",\n \"Implement policy guardrails to automatically block 'rm -rf' commands unless explicitly whitelisted with an absolute, validated path\",\n \"Consider creating a backup or archive of the target before any destructive action\"\n ]\n}\n```"
},
"usage": {
"prompt_tokens": 259,
"completion_tokens": 782,
"total_tokens": 1041
},
"latency_seconds": 25.121
},
{
"purpose": "dangerous_operation_review",
"called_at_utc": "2026-07-29T22:20:22.117029+00:00",
"provider": "kimi",
"request": {
"model": "kimi-k3",
"messages": [
{
"role": "system",
"content": "You are a cautious safety reviewer. Approve operations that are safe and reject risky ones."
},
{
"role": "user",
"content": "You are a safety reviewer for an AI agent execution system.\nReview the following operation and determine if it should be approved.\n\nOperation: code_execution\nDetails: {\n \"code\": \"import urllib.request\\ntry:\\n print(urllib.request.urlopen('https://example.com', timeout=3).status)\\nexcept Exception as e:\\n print(type(e).__name__, str(e))\\n\",\n \"language\": \"python\",\n \"detected_patterns\": [\n \"open(\"\n ]\n}\n\nAnalyze the operation for:\n1. Potential data loss or destructive actions\n2. Security risks\n3. Resource consumption concerns\n4. Compliance with best practices\n\nRespond in JSON format:\n{\n \"approved\": true/false,\n \"reason\": \"Brief explanation of your decision\",\n \"risk_level\": \"low/medium/high\",\n \"recommendations\": [\"List of recommendations if any\"]\n}\n"
}
],
"temperature": 1,
"max_tokens": 4096
},
"response": {
"id": "chatcmpl-6a6a7c9605fd318b0d416518",
"model": "kimi-k3",
"finish_reason": "stop",
"content": "```json\n{\n \"approved\": true,\n \"reason\": \"The code performs a single, read-only HTTPS GET request to example.com (an IANA-reserved documentation domain) with a 3-second timeout and proper exception handling. It only prints the HTTP status code, sends no data, writes no files, and performs no destructive actions. The detected 'open(' pattern is a false positive matching 'urlopen(', not file access.\",\n \"risk_level\": \"low\",\n \"recommendations\": [\n \"Confirm that outbound network access is permitted in this execution environment's policy\",\n \"Consider restricting network egress to an allowlist of trusted domains as a general safeguard\",\n \"The code follows good practices (timeout, try/except, HTTPS); no changes required\"\n ]\n}\n```"
},
"usage": {
"prompt_tokens": 298,
"completion_tokens": 544,
"total_tokens": 842
},
"latency_seconds": 16.405
}
]
@@ -0,0 +1,66 @@
[
{
"purpose": "dangerous_operation_review",
"called_at_utc": "2026-07-29T22:20:05.549577+00:00",
"provider": "kimi",
"request": {
"model": "kimi-k3",
"messages": [
{
"role": "system",
"content": "You are a cautious safety reviewer. Approve operations that are safe and reject risky ones."
},
{
"role": "user",
"content": "You are a safety reviewer for an AI agent execution system.\nReview the following operation and determine if it should be approved.\n\nOperation: terminal_command\nDetails: {\n \"command\": \"rm -rf ./should-never-execute\",\n \"detected_patterns\": [\n \"rm -rf\"\n ]\n}\n\nAnalyze the operation for:\n1. Potential data loss or destructive actions\n2. Security risks\n3. Resource consumption concerns\n4. Compliance with best practices\n\nRespond in JSON format:\n{\n \"approved\": true/false,\n \"reason\": \"Brief explanation of your decision\",\n \"risk_level\": \"low/medium/high\",\n \"recommendations\": [\"List of recommendations if any\"]\n}\n"
}
],
"temperature": 1,
"max_tokens": 4096
},
"response": {
"id": "chatcmpl-6a6a7c7da8472cac5b5dc12c",
"model": "kimi-k3",
"finish_reason": "stop",
"content": "```json\n{\n \"approved\": false,\n \"reason\": \"The command uses 'rm -rf', which performs irreversible recursive deletion without confirmation prompts. The target directory name 'should-never-execute' strongly signals this operation must not run. Additionally, the relative path means the deletion scope depends on the unknown current working directory, creating risk of unintended data loss.\",\n \"risk_level\": \"high\",\n \"recommendations\": [\n \"Reject this operation outright; the flagged 'rm -rf' pattern and directory naming indicate it should never execute\",\n \"If deletion of this path is ever legitimately required, first verify the working directory (pwd) and inspect contents (ls -la) before proceeding\",\n \"Replace destructive deletion with safer alternatives: move to a trash/quarantine directory, or use interactive deletion (rm -ri)\",\n \"Require explicit human confirmation for any operation matching recursive force-deletion patterns\",\n \"Implement policy guardrails to automatically block 'rm -rf' commands unless explicitly whitelisted with an absolute, validated path\",\n \"Consider creating a backup or archive of the target before any destructive action\"\n ]\n}\n```"
},
"usage": {
"prompt_tokens": 259,
"completion_tokens": 782,
"total_tokens": 1041
},
"latency_seconds": 25.121
},
{
"purpose": "dangerous_operation_review",
"called_at_utc": "2026-07-29T22:20:22.117029+00:00",
"provider": "kimi",
"request": {
"model": "kimi-k3",
"messages": [
{
"role": "system",
"content": "You are a cautious safety reviewer. Approve operations that are safe and reject risky ones."
},
{
"role": "user",
"content": "You are a safety reviewer for an AI agent execution system.\nReview the following operation and determine if it should be approved.\n\nOperation: code_execution\nDetails: {\n \"code\": \"import urllib.request\\ntry:\\n print(urllib.request.urlopen('https://example.com', timeout=3).status)\\nexcept Exception as e:\\n print(type(e).__name__, str(e))\\n\",\n \"language\": \"python\",\n \"detected_patterns\": [\n \"open(\"\n ]\n}\n\nAnalyze the operation for:\n1. Potential data loss or destructive actions\n2. Security risks\n3. Resource consumption concerns\n4. Compliance with best practices\n\nRespond in JSON format:\n{\n \"approved\": true/false,\n \"reason\": \"Brief explanation of your decision\",\n \"risk_level\": \"low/medium/high\",\n \"recommendations\": [\"List of recommendations if any\"]\n}\n"
}
],
"temperature": 1,
"max_tokens": 4096
},
"response": {
"id": "chatcmpl-6a6a7c9605fd318b0d416518",
"model": "kimi-k3",
"finish_reason": "stop",
"content": "```json\n{\n \"approved\": true,\n \"reason\": \"The code performs a single, read-only HTTPS GET request to example.com (an IANA-reserved documentation domain) with a 3-second timeout and proper exception handling. It only prints the HTTP status code, sends no data, writes no files, and performs no destructive actions. The detected 'open(' pattern is a false positive matching 'urlopen(', not file access.\",\n \"risk_level\": \"low\",\n \"recommendations\": [\n \"Confirm that outbound network access is permitted in this execution environment's policy\",\n \"Consider restricting network egress to an allowlist of trusted domains as a general safeguard\",\n \"The code follows good practices (timeout, try/except, HTTPS); no changes required\"\n ]\n}\n```"
},
"usage": {
"prompt_tokens": 298,
"completion_tokens": 544,
"total_tokens": 842
},
"latency_seconds": 16.405
}
]
@@ -0,0 +1,158 @@
{
"experiment": "4-3",
"campaign_id": "real_mcp_20260730T062500Z",
"status": "blocked",
"official_complete": false,
"files": [
{
"path": "catalog.json",
"bytes": 7135,
"sha256": "a2459670d25b4cce95b6709846934d6600e1c2eac6090cd77ff6139369ad9c58"
},
{
"path": "llm_receipts.checkpoint.json",
"bytes": 5129,
"sha256": "c2fc88cedae848981afe8bbb66673dfe8b2dfd7f5fa043fc818661c1030d8fd6"
},
{
"path": "llm_receipts.json",
"bytes": 5130,
"sha256": "4a004b17ad738a6fc025def17e21752b1e3469ab028ecf755df1c20b0d4bb7ce"
},
{
"path": "outside-witness.txt",
"bytes": 16,
"sha256": "de6e8ea7f35c8a0261f7fb9eb75022a92311cfd84248567104f5c9e7d3ddf782"
},
{
"path": "protocol.json",
"bytes": 1067,
"sha256": "f8ca33de720405502a7f0df26a2c9a4bf3988a6eee235500a1355d258ebaebc0"
},
{
"path": "receipts/01_python_valid_write.json",
"bytes": 504,
"sha256": "37bc5a682d57a9eb27fec152853cfe66e7c749632e58e14dc73e35156a8ca28e"
},
{
"path": "receipts/02_python_invalid_rejected.json",
"bytes": 417,
"sha256": "b45cf262489b95361bb0b447fe2f8c8c13cba7a85ec667093d26ae0d683eaae7"
},
{
"path": "receipts/03_javascript_valid_write.json",
"bytes": 516,
"sha256": "c03a9605a65497993e72260f6a9e633bbe8074eb4c479291753d9522411d8b2e"
},
{
"path": "receipts/04_javascript_invalid_rejected.json",
"bytes": 897,
"sha256": "610a32ec012ec46669b0969b0fc301193fbe5998a068bf7b5dd50b5fc6fbaa2b"
},
{
"path": "receipts/05_verified_edit.json",
"bytes": 519,
"sha256": "c48383e59f6bce36e6578a19f1a4be26aacd1de7c1de91e525cf354221d33d43"
},
{
"path": "receipts/06_path_escape_rejected.json",
"bytes": 369,
"sha256": "8f778b3d855f06b85c6d81f23d4e905dc46c438a3669d841324e1578e094b678"
},
{
"path": "receipts/07_terminal_safe.json",
"bytes": 494,
"sha256": "4637b9a43250b8f65806d9655f970ed0ca362192050ee41ae932e265d1889948"
},
{
"path": "receipts/08_terminal_timeout.json",
"bytes": 307,
"sha256": "692ae82a1a80008ddabede71d795ec367f95a8ab30ed808f2cb67c72930fae60"
},
{
"path": "receipts/09_terminal_danger_rejected.json",
"bytes": 682,
"sha256": "dea8813966af4346cd97a7ca55aeb2c9f2d3f73ae5cd91ff65ab4882aa93b84d"
},
{
"path": "receipts/10_python_docker_sandbox.json",
"bytes": 1126,
"sha256": "6bc08e992ef73a34eb14850e51eb489ce4d7940dca68607ca258a37c1958c0f1"
},
{
"path": "receipts/11_python_network_denied.json",
"bytes": 1011,
"sha256": "e38c6a1d6423deda44e72057bdf4568e8fa4bfa1b6c5bf44b9654d31e82e09b7"
},
{
"path": "receipts/12_long_output_persisted.json",
"bytes": 2176,
"sha256": "3a84fc3cf588a45df0d70b2557565ea73d90483bcd7d7bf69f81b12007f79328"
},
{
"path": "receipts/13_excel_formula_screenshot.json",
"bytes": 1469,
"sha256": "5369cebd287e80969af39f17286bea44cedd16690999eb9f7aa4faa7d7f33384"
},
{
"path": "receipts/14_real_webhook.json",
"bytes": 1150,
"sha256": "e6a1343693070eeabff7ea6c3c03f527f4ddb52437cea1a4cd8f22179fee9e5f"
},
{
"path": "receipts/15_real_browser.json",
"bytes": 884,
"sha256": "000f0f374fb5f3738706c7c06d17bce4184c83259b9f92f94a6b5fc250f01abc"
},
{
"path": "receipts/16_calendar_preflight.json",
"bytes": 442,
"sha256": "67b317de35158904b5b08e891d4a8e31bbe25a94e4d1cfe88ffeebb3d2433556"
},
{
"path": "receipts/17_github_pr_preflight.json",
"bytes": 462,
"sha256": "a39311ace49b1e2e4db4c614f59f7e7374b83cad38df38a22be0260a041d8e82"
},
{
"path": "receipts/18_desktop_mobile_capabilities.json",
"bytes": 489,
"sha256": "6b20317fda1651294c714f9f163721e848d637f79a927d48f97d6cf392818579"
},
{
"path": "summary.json",
"bytes": 1279,
"sha256": "7580ee0e25bcef7e931adc36146bf9590334823e75f38c9a4ec11b57bdeb2699"
},
{
"path": "workspace/browser-example.png",
"bytes": 16578,
"sha256": "f21d7a2b1f7739641b8838e2ed2a9a907559cece9397568db6e1ccca197cc7b0"
},
{
"path": "workspace/invoice.pdf",
"bytes": 19487,
"sha256": "a398997cace6b14ee4cd8575124a3be4fd0f1c125958c2e99cbd6ae9f91dbbf5"
},
{
"path": "workspace/invoice.png",
"bytes": 14315,
"sha256": "b97c76df59cc7972772341ea3a391bb4dba8907b65000f1b360005804d39986d"
},
{
"path": "workspace/invoice.xlsx",
"bytes": 5059,
"sha256": "621c89e193243ab849d1d20df53c9deaaabe2e8909712edd87d6c137f5551470"
},
{
"path": "workspace/valid.js",
"bytes": 40,
"sha256": "799574240050acc326491093ba5641e3eb6ec281fc8f7a0a259b80a0a51724cd"
},
{
"path": "workspace/valid.py",
"bytes": 32,
"sha256": "e1a894022d1a082987b87adecb623438c9e386d86b2b621cff4a5fe7fdf7edc8"
}
]
}
@@ -0,0 +1,45 @@
{
"experiment": "4-3",
"authority": "book/chapter4.md:274",
"required_categories": {
"file_write_edit": [
"python_linter",
"javascript_linter",
"structured_errors"
],
"terminal": [
"timeout",
"dangerous_command_review",
"history_or_receipt"
],
"code_interpreter": [
"real_sandbox",
"dangerous_operation_gate",
"long_output_persisted"
],
"data": [
"excel_write",
"formula",
"screenshot"
],
"external": [
"calendar",
"github_pr",
"email",
"webhook"
],
"gui": [
"browser",
"virtual_desktop",
"virtual_mobile"
]
},
"safety": {
"workspace_confinement": true,
"automatic_linter": true,
"llm_driven_danger_review": true,
"long_output_head_tail_and_full_file": true,
"credential_free_receipts": true
},
"completion_rule": "Every named manuscript category must have substantive real execution evidence; missing credentials or active GUI backends produce blocked, never passed."
}
@@ -0,0 +1,18 @@
{
"case": "python_valid_write",
"tool": "file_write",
"arguments": {
"path": "valid.py",
"content": "def add(a, b):\n return a + b\n",
"overwrite": true
},
"transport": "mcp-stdio",
"mcp_result_is_error": false,
"payload": {
"success": true,
"path": "/Users/boj/book/ai-agent-book/chapter4/execution-tools/validation/experiment_4_3/real_mcp_20260730T062500Z/workspace/valid.py",
"bytes_written": 32,
"verification": "passed"
},
"latency_seconds": 0.002
}
@@ -0,0 +1,17 @@
{
"case": "python_invalid_rejected",
"tool": "file_write",
"arguments": {
"path": "invalid.py",
"content": "def broken(:\n pass\n",
"overwrite": true
},
"transport": "mcp-stdio",
"mcp_result_is_error": false,
"payload": {
"success": false,
"error": "Syntax validation failed: Syntax error at line 1: invalid syntax",
"verification": "failed"
},
"latency_seconds": 0.001
}
@@ -0,0 +1,18 @@
{
"case": "javascript_valid_write",
"tool": "file_write",
"arguments": {
"path": "valid.js",
"content": "const answer = 42;\nconsole.log(answer);\n",
"overwrite": true
},
"transport": "mcp-stdio",
"mcp_result_is_error": false,
"payload": {
"success": true,
"path": "/Users/boj/book/ai-agent-book/chapter4/execution-tools/validation/experiment_4_3/real_mcp_20260730T062500Z/workspace/valid.js",
"bytes_written": 40,
"verification": "passed"
},
"latency_seconds": 0.066
}
@@ -0,0 +1,17 @@
{
"case": "javascript_invalid_rejected",
"tool": "file_write",
"arguments": {
"path": "invalid.js",
"content": "const broken = ;\n",
"overwrite": true
},
"transport": "mcp-stdio",
"mcp_result_is_error": false,
"payload": {
"success": false,
"error": "Syntax validation failed: [stdin]:1\nconst broken = ;\n ^\n\nSyntaxError: Unexpected token ';'\n at wrapSafe (node:internal/modules/cjs/loader:1740:18)\n at checkSyntax (node:internal/main/check_syntax:76:3)\n at node:internal/main/check_syntax:45:5\n at Socket.<anonymous> (node:internal/process/execution:205:5)\n at Socket.emit (node:events:520:22)\n at endReadableNT (node:internal/streams/readable:1729:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:90:21)\n\nNode.js v25.6.0",
"verification": "failed"
},
"latency_seconds": 0.066
}
@@ -0,0 +1,18 @@
{
"case": "verified_edit",
"tool": "file_edit",
"arguments": {
"path": "valid.py",
"search": "a + b",
"replace": "a - b"
},
"transport": "mcp-stdio",
"mcp_result_is_error": false,
"payload": {
"success": true,
"path": "/Users/boj/book/ai-agent-book/chapter4/execution-tools/validation/experiment_4_3/real_mcp_20260730T062500Z/workspace/valid.py",
"diff_preview": "Line 2:\n - return a + b\n + return a - b",
"verification": "passed"
},
"latency_seconds": 0.002
}
@@ -0,0 +1,16 @@
{
"case": "path_escape_rejected",
"tool": "file_write",
"arguments": {
"path": "../../escape.py",
"content": "print('escape')\n",
"overwrite": true
},
"transport": "mcp-stdio",
"mcp_result_is_error": false,
"payload": {
"success": false,
"error": "Path ../../escape.py is outside workspace directory"
},
"latency_seconds": 0.002
}
@@ -0,0 +1,19 @@
{
"case": "terminal_safe",
"tool": "virtual_terminal",
"arguments": {
"command": "pwd && printf SAFE",
"timeout": 10
},
"transport": "mcp-stdio",
"mcp_result_is_error": false,
"payload": {
"success": true,
"returncode": 0,
"stdout": "/Users/boj/book/ai-agent-book/chapter4/execution-tools/validation/experiment_4_3/real_mcp_20260730T062500Z/workspace\nSAFE",
"stderr": "",
"stdout_file": null,
"stderr_file": null
},
"latency_seconds": 0.007
}
@@ -0,0 +1,15 @@
{
"case": "terminal_timeout",
"tool": "virtual_terminal",
"arguments": {
"command": "sleep 2",
"timeout": 1
},
"transport": "mcp-stdio",
"mcp_result_is_error": false,
"payload": {
"success": false,
"error": "Command timed out after 1 seconds"
},
"latency_seconds": 1.008
}
@@ -0,0 +1,15 @@
{
"case": "terminal_danger_rejected",
"tool": "virtual_terminal",
"arguments": {
"command": "rm -rf ./should-never-execute",
"timeout": 10
},
"transport": "mcp-stdio",
"mcp_result_is_error": false,
"payload": {
"success": false,
"error": "Command execution not approved: The command uses 'rm -rf', which performs irreversible recursive deletion without confirmation prompts. The target directory name 'should-never-execute' strongly signals this operation must not run. Additionally, the relative path means the deletion scope depends on the unknown current working directory, creating risk of unintended data loss."
},
"latency_seconds": 25.182
}
@@ -0,0 +1,36 @@
{
"case": "python_docker_sandbox",
"tool": "code_interpreter",
"arguments": {
"language": "python",
"timeout": 30,
"code": "import os, json\nprint(json.dumps({'root': os.listdir('/'), 'network_proxy': os.environ.get('HTTPS_PROXY')}))\n"
},
"transport": "mcp-stdio",
"mcp_result_is_error": false,
"payload": {
"success": true,
"status": "success",
"language": "python",
"stdout": "{\"root\": [\"sys\", \"root\", \"boot\", \"opt\", \"sbin\", \"srv\", \"dev\", \"media\", \"proc\", \"var\", \"tmp\", \"etc\", \"home\", \"lib\", \"usr\", \"run\", \"mnt\", \"bin\", \"workspace\", \".dockerenv\"], \"network_proxy\": null}\n",
"stderr": "",
"stdout_file": null,
"stderr_file": null,
"returncode": 0,
"error": null,
"compile_output": null,
"phase": null,
"execution_time": 0.15053701400756836,
"sandbox": {
"kind": "docker",
"image": "python:3.11-slim",
"network": "none",
"rootfs": "read-only",
"memory": "256m",
"cpus": 1,
"pids_limit": 64
},
"verification": "passed"
},
"latency_seconds": 0.158
}
@@ -0,0 +1,36 @@
{
"case": "python_network_denied",
"tool": "code_interpreter",
"arguments": {
"language": "python",
"timeout": 30,
"code": "import urllib.request\ntry:\n print(urllib.request.urlopen('https://example.com', timeout=3).status)\nexcept Exception as e:\n print(type(e).__name__, str(e))\n"
},
"transport": "mcp-stdio",
"mcp_result_is_error": false,
"payload": {
"success": true,
"status": "success",
"language": "python",
"stdout": "URLError <urlopen error [Errno -3] Temporary failure in name resolution>\n",
"stderr": "",
"stdout_file": null,
"stderr_file": null,
"returncode": 0,
"error": null,
"compile_output": null,
"phase": null,
"execution_time": 0.27611231803894043,
"sandbox": {
"kind": "docker",
"image": "python:3.11-slim",
"network": "none",
"rootfs": "read-only",
"memory": "256m",
"cpus": 1,
"pids_limit": 64
},
"verification": "passed"
},
"latency_seconds": 16.694
}
@@ -0,0 +1,36 @@
{
"case": "long_output_persisted",
"tool": "code_interpreter",
"arguments": {
"language": "python",
"timeout": 30,
"code": "for i in range(260): print(f'LINE-{i:03d}')\n"
},
"transport": "mcp-stdio",
"mcp_result_is_error": false,
"payload": {
"success": true,
"status": "success",
"language": "python",
"stdout": "LINE-000\nLINE-001\nLINE-002\nLINE-003\nLINE-004\nLINE-005\nLINE-006\nLINE-007\nLINE-008\nLINE-009\nLINE-010\nLINE-011\nLINE-012\nLINE-013\nLINE-014\nLINE-015\nLINE-016\nLINE-017\nLINE-018\nLINE-019\nLINE-020\nLINE-021\nLINE-022\nLINE-023\nLINE-024\nLINE-025\nLINE-026\nLINE-027\nLINE-028\nLINE-029\nLINE-030\nLINE-031\nLINE-032\nLINE-033\nLINE-034\nLINE-035\nLINE-036\nLINE-037\nLINE-038\nLINE-039\nLINE-040\nLINE-041\nLINE-042\nLINE-043\nLINE-044\nLINE-045\nLINE-046\nLINE-047\nLINE-048\nLINE-049\n... [省略 161 行,完整输出已保存至 /var/folders/0l/vk1w1b5n2fxfwdlz3f_w25_w0000gp/T/code_interpreter_output_psx202sw.txt] ...\nLINE-211\nLINE-212\nLINE-213\nLINE-214\nLINE-215\nLINE-216\nLINE-217\nLINE-218\nLINE-219\nLINE-220\nLINE-221\nLINE-222\nLINE-223\nLINE-224\nLINE-225\nLINE-226\nLINE-227\nLINE-228\nLINE-229\nLINE-230\nLINE-231\nLINE-232\nLINE-233\nLINE-234\nLINE-235\nLINE-236\nLINE-237\nLINE-238\nLINE-239\nLINE-240\nLINE-241\nLINE-242\nLINE-243\nLINE-244\nLINE-245\nLINE-246\nLINE-247\nLINE-248\nLINE-249\nLINE-250\nLINE-251\nLINE-252\nLINE-253\nLINE-254\nLINE-255\nLINE-256\nLINE-257\nLINE-258\nLINE-259\n\n[如需完整输出,请使用 read_file 工具读取 /var/folders/0l/vk1w1b5n2fxfwdlz3f_w25_w0000gp/T/code_interpreter_output_psx202sw.txt]",
"stderr": "",
"stdout_file": "/var/folders/0l/vk1w1b5n2fxfwdlz3f_w25_w0000gp/T/code_interpreter_output_psx202sw.txt",
"stderr_file": null,
"returncode": 0,
"error": null,
"compile_output": null,
"phase": null,
"execution_time": 0.12428689002990723,
"sandbox": {
"kind": "docker",
"image": "python:3.11-slim",
"network": "none",
"rootfs": "read-only",
"memory": "256m",
"cpus": 1,
"pids_limit": 64
},
"verification": "passed"
},
"latency_seconds": 0.135
}
@@ -0,0 +1,48 @@
{
"case": "excel_formula_screenshot",
"tool": "excel_create_with_formula_and_screenshot",
"arguments": {
"output_path": "invoice.xlsx",
"rows": [
{
"item": "Compute",
"quantity": 2,
"unit_price": 12.5
},
{
"item": "Storage",
"quantity": 3,
"unit_price": 7.0
}
]
},
"transport": "mcp-stdio",
"mcp_result_is_error": false,
"payload": {
"success": true,
"xlsx": {
"path": "/Users/boj/book/ai-agent-book/chapter4/execution-tools/validation/experiment_4_3/real_mcp_20260730T062500Z/workspace/invoice.xlsx",
"bytes": 5059,
"sha256": "621c89e193243ab849d1d20df53c9deaaabe2e8909712edd87d6c137f5551470"
},
"pdf": {
"path": "/Users/boj/book/ai-agent-book/chapter4/execution-tools/validation/experiment_4_3/real_mcp_20260730T062500Z/workspace/invoice.pdf",
"bytes": 19487,
"sha256": "a398997cace6b14ee4cd8575124a3be4fd0f1c125958c2e99cbd6ae9f91dbbf5"
},
"screenshot": {
"path": "/Users/boj/book/ai-agent-book/chapter4/execution-tools/validation/experiment_4_3/real_mcp_20260730T062500Z/workspace/invoice.png",
"bytes": 14315,
"sha256": "b97c76df59cc7972772341ea3a391bb4dba8907b65000f1b360005804d39986d"
},
"formula_cells": [
"D2",
"D3",
"D4"
],
"rows": 2,
"renderer": "LibreOffice headless + PyMuPDF",
"latency_seconds": 10.029
},
"latency_seconds": 10.136
}
@@ -0,0 +1,45 @@
{
"case": "real_webhook",
"tool": "webhook_post",
"arguments": {
"url": "https://postman-echo.com/post",
"payload": {
"experiment": "4-3",
"marker": "REAL-WEBHOOK-RECEIPT"
}
},
"transport": "mcp-stdio",
"mcp_result_is_error": false,
"payload": {
"success": true,
"status": 200,
"url": "https://postman-echo.com/post",
"response": {
"args": {},
"data": {
"experiment": "4-3",
"marker": "REAL-WEBHOOK-RECEIPT"
},
"files": {},
"form": {},
"headers": {
"host": "postman-echo.com",
"content-length": "52",
"accept": "*/*",
"content-type": "application/json",
"user-agent": "python-httpx/0.28.1",
"x-forwarded-proto": "https",
"accept-encoding": "gzip, br"
},
"json": {
"experiment": "4-3",
"marker": "REAL-WEBHOOK-RECEIPT"
},
"url": "https://postman-echo.com/post"
},
"response_sha256": "727438d7ad2e56ef124d7b14904d546de199bf2bda40bb56989885625ecc45f2",
"response_bytes": 391,
"latency_seconds": 1.728
},
"latency_seconds": 1.731
}
@@ -0,0 +1,25 @@
{
"case": "real_browser",
"tool": "browser_navigate",
"arguments": {
"url": "https://example.com",
"screenshot_path": "browser-example.png"
},
"transport": "mcp-stdio",
"mcp_result_is_error": false,
"payload": {
"success": true,
"url": "https://example.com",
"status": 200,
"title": "Example Domain",
"body_text": "Example Domain\n\nThis domain is for use in documentation examples without needing permission. Avoid use in operations.\n\nLearn more",
"screenshot": {
"path": "/Users/boj/book/ai-agent-book/chapter4/execution-tools/validation/experiment_4_3/real_mcp_20260730T062500Z/workspace/browser-example.png",
"bytes": 16578,
"sha256": "f21d7a2b1f7739641b8838e2ed2a9a907559cece9397568db6e1ccca197cc7b0"
},
"browser": "Chromium via Playwright",
"latency_seconds": 2.984
},
"latency_seconds": 2.986
}
@@ -0,0 +1,16 @@
{
"case": "calendar_preflight",
"tool": "google_calendar_add",
"arguments": {
"summary": "Experiment 4-3",
"start_time": "2026-08-01T10:00:00+00:00",
"end_time": "2026-08-01T10:30:00+00:00"
},
"transport": "mcp-stdio",
"mcp_result_is_error": false,
"payload": {
"success": false,
"error": "Failed to initialize Google Calendar: Credentials file not found: credentials.json"
},
"latency_seconds": 0.002
}
@@ -0,0 +1,17 @@
{
"case": "github_pr_preflight",
"tool": "github_create_pr",
"arguments": {
"repo_name": "bojieli/ai-agent-book",
"title": "Experiment 4-3 preflight",
"body": "Credential-gated preflight",
"head_branch": "nonexistent-exp4-3"
},
"transport": "mcp-stdio",
"mcp_result_is_error": false,
"payload": {
"success": false,
"error": "Failed to initialize GitHub client: GitHub token not configured"
},
"latency_seconds": 0.002
}
@@ -0,0 +1,16 @@
{
"case": "desktop_mobile_capabilities",
"tool": "environment_capabilities",
"arguments": {},
"transport": "mcp-stdio",
"mcp_result_is_error": false,
"payload": {
"success": true,
"computer_use_container_image_present": true,
"computer_use_active_session": false,
"android_world_adb_present": true,
"android_active_devices": [],
"note": "Availability probe only; absent active sessions cannot satisfy execution gates."
},
"latency_seconds": 0.036
}
@@ -0,0 +1,38 @@
{
"experiment": "4-3",
"campaign_id": "real_mcp_20260730T062500Z",
"generated_at": "2026-07-29T22:20:37.628241+00:00",
"status": "blocked",
"official_complete": false,
"gates": {
"real_mcp_catalog_and_calls": true,
"python_and_javascript_linter": true,
"file_edit_verified_and_escape_rejected": true,
"terminal_timeout_and_llm_danger_review": true,
"real_python_container_sandbox": true,
"long_output_truncated_and_persisted": true,
"real_excel_formula_and_screenshot": true,
"real_webhook": true,
"real_browser": true,
"real_calendar_mutation": false,
"real_github_pr_mutation": false,
"real_email_mutation": false,
"real_virtual_desktop_session": false,
"real_virtual_mobile_session": false,
"credential_free_usage_latency_receipts": true
},
"long_output_full_file": {
"path": "/var/folders/0l/vk1w1b5n2fxfwdlz3f_w25_w0000gp/T/code_interpreter_output_psx202sw.txt",
"bytes": 2340,
"sha256": "86b815da715192ef997d8a8d0c6adcaa8b1fdf9aa349889a4fc46462e4c02cb1"
},
"blockers": [
"real_calendar_mutation",
"real_github_pr_mutation",
"real_email_mutation",
"real_virtual_desktop_session",
"real_virtual_mobile_session"
],
"receipt_count": 18,
"llm_call_count": 2
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

@@ -0,0 +1,2 @@
const answer = 42;
console.log(answer);
@@ -0,0 +1,2 @@
def add(a, b):
return a - b