What's New
Structured MCP Error Tokens
All MCP path validation errors now return machine-parseable error tokens with actionable remediation suggestions:
E_WORKDIR_INVALID- working directory doesn't exist or is outside worktreeE_PATH_OUTSIDE_WORKDIR_PROMPT- prompt file outside working directoryE_PATH_OUTSIDE_WORKDIR_OUTPUT- output file outside working directoryE_PATH_RESOLUTION_FAILED- symlink or path resolution failureE_WRITE_FAILED- file write error
Each error includes: requested path, resolved working directory, path policy, and suggested fix.
Configurable Output Path Policy
New mcp-config.ts module with environment variable configuration:
OMC_MCP_OUTPUT_PATH_POLICY=strict|redirect_output- strict (default) rejects out-of-boundary writes; redirect_output redirects to.omc/outputs/OMC_MCP_OUTPUT_REDIRECT_DIR- configurable redirect directory (default:.omc/outputs)OMC_MCP_ALLOW_EXTERNAL_PROMPT=0|1- allow prompt files outside working directory
Security Hardening
- Post-write symlink verification prevents boundary escape via symlink on final file path
- Error token format standardized across codex-core and gemini-core
isExternalPromptAllowed()wired into prompt boundary checks in both cores
Internal
safeWriteOutputFilerefactored to sync, returns typedSafeWriteResult- Removed dead
redirectOutputPath()from mcp-config.ts - MCP path boundary rules documented in REFERENCE.md