Skip to content

Defense in Depth ​

Triggerfish implements security as 13 independent, overlapping layers. No single layer is sufficient on its own. Together, they form a defense that degrades gracefully -- even if one layer is compromised, the remaining layers continue to protect the system.

SECURITY Defense in depth means that a vulnerability in any single

layer does not compromise the system. An attacker who bypasses channel authentication still faces session taint tracking, policy hooks, and audit logging. An LLM that is prompt-injected still cannot influence the deterministic policy layer below it. :::

The 13 Layers ​

Layer 1: Channel Authentication ​

Protects against: Impersonation, unauthorized access, identity confusion.

Identity is determined by code at session establishment, not by the LLM interpreting message content. Before the LLM sees any message, the channel adapter tags it with an immutable label:

{ source: "owner" }    -- verified channel identity matches registered owner
{ source: "external" } -- anyone else; input only, not treated as command

Authentication methods vary by channel:

ChannelMethodVerification
Telegram / WhatsAppPairing codeOne-time code, 5-minute expiry, sent from user's account
Slack / Discord / TeamsOAuthPlatform OAuth consent flow, returns verified user ID
CLILocal processRunning on the user's machine, authenticated by OS
WebChatNone (public)All visitors are EXTERNAL, never owner
EmailUnauthenticatedIncoming messages are non-owner; From matching grants no ownership

The LLM never decides who is the owner. A message saying "I am the

owner" from an unverified sender is tagged { source: "external" } and cannot trigger owner-level commands. This decision is made in code, before the LLM processes the message. :::

Layer 2: Permission-Aware Data Access ​

Protects against: Over-permissioned data access, privilege escalation through system credentials.

Triggerfish uses the user's delegated OAuth tokens -- not system service accounts -- to query external systems. The source system enforces its own permission model:

Traditional vs Triggerfish: traditional model gives LLM direct control, Triggerfish routes all actions through a deterministic policy layer

Source systems enforce the permissions of the configured integration account. Trusted plugins execute in process; an SDK credential API is not an isolation boundary against plugin code. Grant plugin trust only after reviewing that code.

Layer 3: Session Taint Tracking ​

Protects against: Data leakage through context contamination, classified data reaching lower-classification channels.

Every session independently tracks a taint level that reflects the highest classification of data accessed during the session. Taint follows three invariants:

  1. Per-conversation -- each session has its own taint
  2. Escalation only -- taint increases, never decreases
  3. Full reset clears everything -- taint AND history are wiped together

When the policy engine evaluates an output, it compares the session's taint against the target channel's effective classification. If the taint exceeds the target, the output is blocked.

Layer 4: Data Lineage ​

Protects against: Untraceable data flows, inability to audit where data went, compliance gaps.

Every data element carries provenance metadata from origin to destination:

  • Origin: Which integration, record, and user access produced this data
  • Classification: What level was assigned and why
  • Transformations: How the LLM modified, summarized, or combined the data
  • Destination: Which session and channel received the output

Lineage enables forward traces ("where did this Salesforce record go?"), backward traces ("what sources contributed to this output?"), and full compliance exports.

Layer 5: Policy Enforcement Hooks ​

Protects against: Prompt injection attacks, LLM-driven security bypasses, uncontrolled tool execution.

Five active deterministic hooks intercept the managed context, tool, output, and MCP call paths:

HookWhat it intercepts
PRE_CONTEXT_INJECTIONExternal input entering the context window
PRE_TOOL_CALLLLM requesting tool execution
POST_TOOL_RESPONSEData returning from tool execution
PRE_OUTPUTResponse about to leave the system
MCP_TOOL_CALLMCP server tool invocation

Hooks are pure code: deterministic, synchronous, logged, and unforgeable. The LLM cannot bypass them because there is no pathway from LLM output to hook configuration. The hook layer does not parse LLM output for commands.

Layer 6: MCP Gateway ​

Protects against: Uncontrolled external tool access, unclassified data entering through MCP servers, schema violations.

All MCP servers default to UNTRUSTED and cannot be invoked until an admin or user classifies them. The Gateway enforces:

  • Server authentication and classification status
  • Tool-level permissions (individual tools can be blocked even if the server is allowed)
  • Request/response schema validation
  • Taint tracking on all MCP responses
  • Injection pattern scanning in parameters
MCP server states: UNTRUSTED (default), CLASSIFIED (reviewed and permitted), BLOCKED (explicitly prohibited)

Layer 7: Plugin Execution Grants ​

Protects against: Execution of disabled or unapproved plugin code.

Plugin imports require an explicit enabled/trusted grant in user configuration. The agent's configuration tool cannot grant that trust, and downloads do not enable execution. Plugin tool calls have a RESTRICTED classification floor.

Trusted plugins execute in process with Triggerfish's permissions. They are not isolated from the network, filesystem, credentials, or other process state. Enable only plugins whose code you trust with that access. See Plugins for configuration and execution requirements.

Layer 8: Secrets Isolation ​

Protects against: Credential theft, secrets in config files, plaintext credential storage.

Credentials are stored in the OS keychain (personal tier) or vault integration (enterprise tier). They never appear in:

  • Configuration files
  • StorageProvider values
  • Log entries
  • LLM context (credentials are injected at the HTTP layer, below the LLM)

Infrastructure clients resolve credentials below the LLM. Resource and tool policy gates control access to integration operations.

Layer 9: Filesystem Tool Sandbox ​

Protects against: Path traversal attacks, unauthorized file access, classification bypass via direct filesystem operations.

All filesystem tool operations (read, write, edit, list, search) run inside a sandboxed Deno Worker with OS-level permissions scoped to the session's taint-appropriate workspace subdirectory. The sandbox enforces three boundaries:

  • Path jail — every path is resolved to an absolute path and checked against the jail root with separator-aware matching. Traversal attempts (../) that escape the workspace are rejected before any I/O occurs
  • Path classification — every filesystem path is classified through a fixed resolution chain: hardcoded protected paths (RESTRICTED), workspace classification directories, configured path mappings, then default classification. The agent cannot access paths above its session taint
  • Taint-scoped permissions — the sandbox Worker's Deno permissions are set to the workspace subdirectory matching the session's current taint level. When taint escalates, the Worker is respawned with expanded permissions. Permissions can only widen, never narrow within a session
  • Write protection — critical files (TRIGGER.md, triggerfish.yaml, SPINE.md) are write-protected at the tool layer regardless of sandbox permissions. These files can only be modified through dedicated management tools that enforce their own classification rules

Layer 10: Agent Identity ​

Protects against: Privilege escalation through agent chains, data laundering via delegation.

Agent operations use managed sessions and tool policy checks. Session sends compare the source and target sessions' current taint levels, with the target classification derived from stored session state. Channel sends use the caller's live taint and the destination channel's classification. These checks block write-downs to lower-classification destinations.

Layer 11: Audit Logging ​

Protects against: Undetectable breaches, compliance failures, inability to investigate incidents.

Every security-relevant decision is logged with full context:

json
{
  "timestamp": "2025-01-29T10:23:45Z",
  "user_id": "user_123",
  "session_id": "sess_456",
  "action": "slack.postMessage",
  "target_channel": "external_webhook",
  "session_taint": "CONFIDENTIAL",
  "target_classification": "PUBLIC",
  "decision": "DENIED",
  "reason": "classification_violation",
  "hook": "PRE_OUTPUT",
  "policy_rules_evaluated": ["rule_001", "rule_002"],
  "lineage_ids": ["lin_789", "lin_790"]
}

What gets logged:

  • All action requests (allowed AND denied)
  • Classification decisions
  • Session taint changes
  • Channel authentication events
  • Policy rule evaluations
  • Lineage record creation and updates
  • MCP Gateway decisions
  • Agent-to-agent invocations

Audit logging cannot be disabled. It is a fixed rule in the policy

hierarchy. Even an org admin cannot turn off logging for their own actions. Enterprise deployments can optionally enable full content logging (including blocked message content) for forensic requirements. :::

Layer 12: SSRF Prevention ​

Protects against: Server-side request forgery, internal network reconnaissance, cloud metadata exfiltration.

Managed HTTP requests and browser traffic use a loopback policy proxy. It checks the resolved addresses against the hardcoded private/reserved denylist and connects to the approved literal IP, preserving end-to-end TLS hostname verification. Trusted plugins can use process networking directly and are outside this managed transport boundary.

  • Private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are always blocked
  • Link-local (169.254.0.0/16) and cloud metadata endpoints are blocked
  • Loopback (127.0.0.0/8) is blocked
  • The denylist is hardcoded and not configurable -- there is no admin override
  • Each connection uses its approved IP without a second DNS lookup
  • Redirect destinations are checked again
  • Chrome has no direct proxy fallback or implicit loopback bypass; QUIC and non-proxied WebRTC UDP are disabled

Layer 13: Memory Classification Gating ​

Protects against: Cross-session data leakage through memory, classification downgrade via memory writes, unauthorized access to classified memories.

The cross-session memory system enforces classification at both write and read time:

  • Writes: Memory entries are forced to the current session's taint level. The LLM cannot choose a lower classification for stored memories.
  • Reads: Memory queries are filtered by canFlowTo -- a session can only read memories at or below its current taint level.

This prevents an agent from storing CONFIDENTIAL data as PUBLIC in memory and later retrieving it in a lower-taint session to bypass the no-write-down rule.

Trust Hierarchy ​

The trust model defines who has authority over what. Higher tiers cannot bypass lower-tier security rules, but they can configure the adjustable parameters within those rules.

Trust hierarchy: Triggerfish vendor (zero access), Org Admin (sets policies), Employee (uses agent within boundaries)

Personal tier: The user IS the org admin. Full sovereignty. No

Triggerfish visibility. The vendor has zero access to user data by default and can only gain access through an explicit, time-bound, logged grant from the user. :::

How the Layers Work Together ​

Consider a prompt injection attack where a malicious message attempts to exfiltrate data:

StepLayerAction
1Channel authenticationMessage tagged { source: "external" } -- not owner
2PRE_CONTEXT_INJECTIONInput scanned for injection patterns, classified
3Session taintSession taint unchanged (no classified data accessed)
4LLM processes messageLLM may be manipulated into requesting a tool call
5PRE_TOOL_CALLTool permission check against external-source rules
6POST_TOOL_RESPONSEAny returned data classified, taint updated
7PRE_OUTPUTOutput classification vs. target checked
8Audit loggingEntire sequence recorded for review

Even if the LLM is fully compromised at step 4 and requests a data exfiltration tool call, the remaining layers (permission checks, taint tracking, output classification, audit logging) continue to enforce policy. No single point of failure compromises the system.