Skip to content

Security Model

WarToolsAI enforces defense-in-depth across every runtime implementation:

  1. Default-Off Execution Policy: Calling any disabled tool immediately returns ok: false with error.code = "TOOL_DISABLED".
  2. Filesystem Sandboxing (fs.*):
  3. All paths are resolved relative to canonical fsRoot.
  4. ../ traversal, absolute paths, and symlink targets pointing outside fsRoot (verified via realpath) are rejected with SANDBOX_PATH_DENIED.
  5. Outbound Web SSRF Protection (web.*):
  6. Only http: and https: protocols are permitted (UNSUPPORTED_PROTOCOL).
  7. Targets must match security.httpAllowDomains and not match security.httpBlockDomains (DOMAIN_NOT_ALLOWED).
  8. Literal and DNS-resolved private, loopback, and link-local IP addresses are blocked (PRIVATE_NETWORK_BLOCKED).
  9. Redirects (3xx) are handled manually and re-validated at every hop.
  10. Request timeouts return structured TIMEOUT errors.
  11. AST-Only Math (math.eval):
  12. Uses a recursive-descent parser with no eval() or dynamic code execution (EXPRESSION_ERROR, DIVISION_BY_ZERO).
  13. Bounded Outputs:
  14. Every response tracks meta.truncated against security.maxOutputChars.