Security Model
WarToolsAI enforces defense-in-depth across every runtime implementation:
- Default-Off Execution Policy: Calling any disabled tool immediately returns
ok: falsewitherror.code = "TOOL_DISABLED". - Filesystem Sandboxing (
fs.*): - All paths are resolved relative to canonical
fsRoot. ../traversal, absolute paths, and symlink targets pointing outsidefsRoot(verified viarealpath) are rejected withSANDBOX_PATH_DENIED.- Outbound Web SSRF Protection (
web.*): - Only
http:andhttps:protocols are permitted (UNSUPPORTED_PROTOCOL). - Targets must match
security.httpAllowDomainsand not matchsecurity.httpBlockDomains(DOMAIN_NOT_ALLOWED). - Literal and DNS-resolved private, loopback, and link-local IP addresses are blocked (
PRIVATE_NETWORK_BLOCKED). - Redirects (
3xx) are handled manually and re-validated at every hop. - Request timeouts return structured
TIMEOUTerrors. - AST-Only Math (
math.eval): - Uses a recursive-descent parser with no
eval()or dynamic code execution (EXPRESSION_ERROR,DIVISION_BY_ZERO). - Bounded Outputs:
- Every response tracks
meta.truncatedagainstsecurity.maxOutputChars.