Scope: one trust boundary per gateway

Before changing remote access, DM policy, reverse proxy, or public exposure, run through the Gateway exposure runbook as a pre-flight/rollback checklist.

Trust boundary matrix

Quick model for triaging risk reports:

Boundary or control What it means Common misread
gateway.auth (token/password/trusted-proxy/device auth) Authenticates callers to gateway APIs "Needs per-message signatures on every frame to be secure"
sessionKey Routing key for context/session selection "Session key is a user auth boundary"
Prompt/content guardrails Reduce model abuse risk "Prompt injection alone proves auth bypass"
Browser evaluate Intentional operator capability when enabled "Any JS eval primitive is automatically a vuln in this trust model"
Local TUI ! shell Explicit operator-triggered local execution "Local shell convenience command is remote injection"
Node pairing and node commands Operator-level remote execution on paired devices "Remote device control should be treated as untrusted user access by default"
gateway.nodes.pairing.autoApproveCidrs Opt-in trusted-network node enrollment policy "A disabled-by-default allowlist is an automatic pairing vulnerability"
gateway.nodes.pairing.sshVerify Key-verified node enrollment over operator SSH "Default-on auto-approval is an automatic pairing vulnerability"
tools.sessions.visibility / tools.agentToAgent Session-tool reach inside one Gateway; Gateway-wide and on by default "Default cross-agent session access is a tenant-isolation bypass"

Not vulnerabilities by design

Common findings closed as no-action
  • Prompt-injection-only chains without a policy, auth, or sandbox bypass.
  • Claims that assume hostile multi-tenant operation on one shared host or config.
  • Normal operator read-path access (for example sessions.list / sessions.preview / chat.history) classified as IDOR in a shared-gateway setup.
  • Localhost-only deployment findings (for example missing HSTS on a loopback-only gateway).
  • Discord inbound webhook signature findings for inbound paths that do not exist in this repo.
  • Node pairing metadata treated as a hidden second per-command approval layer for system.run; the real execution boundary is the gateway's global node command policy plus the node's own exec approvals.
  • gateway.nodes.pairing.sshVerify treated as a vulnerability because it is enabled by default. It never approves on network locality or SSH reachability alone: the gateway reads the device identity back over SSH (BatchMode, strict host keys) and approves only on an exact device-key match with the pending request, which requires the connecting keypair to already live under the operator's account on a host the operator controls. Checks are bounded to private/CGNAT source addresses, share the trusted-CIDR eligibility floor (fresh scopeless role: node only), and sshVerify: false turns the feature off.
  • gateway.nodes.pairing.autoApproveCidrs treated as a vulnerability by itself. It is disabled by default, requires explicit CIDR/IP entries, only applies to first-time role: node pairing with no requested scopes, and never auto-approves operator/browser/Control UI, WebChat, role/scope upgrades, metadata or public-key changes, or same-host loopback trusted-proxy header paths (even when loopback trusted-proxy auth is enabled).
  • "Missing per-user authorization" findings that treat sessionKey as an auth token.
  • Default Gateway-wide session visibility or default-on agent-to-agent messaging treated as a vulnerability on its own. The audit reports plain multi-agent defaults as info, not a vulnerability finding, and escalates to warn only with trust-boundary signals. One Gateway is one trust boundary; narrow tools.sessions.visibility or tools.agentToAgent for persona separation, and run separate gateways for adversarial users.

Gateway and node trust

Treat Gateway and node as one operator trust domain with different roles:

For hostile-user isolation, split trust boundaries by OS user/host and run separate gateways.

Threat model

Your AI assistant can execute arbitrary shell commands, read/write files, access network services, and send messages to anyone (if given channel access). People who message it can try to trick it into doing bad things, social-engineer access to your data, or check for infrastructure details.

Most failures here are not exotic exploits - they are "someone messaged the bot and the bot did what they asked." Apus's stance, in order:

  1. Identity first - decide who can talk to the bot (DM pairing / allowlists / explicit "open").
  2. Scope next - decide where the bot can act (group allowlists + mention gating, tools, sandboxing, device permissions).
  3. Model last - assume the model can be manipulated; design so manipulation has limited blast radius.

Reporting security issues

Found a vulnerability in Apus? Report responsibly:

  1. Email: security@ami-docs.dev.apuscorp.com
  2. Do not post publicly until fixed.
  3. We will credit you (unless you prefer anonymity).