Skip to main content

Overview

Network rules select which traffic Formal Endpoint intercepts with Transparent Mode. Intercepted traffic undergoes evaluation and logging. A TCP connection is intercepted when an active network rule matches. All the stages within the CEL condition block (pre_tcp, pre_tls and post_tls) must evaluate to true. Create rules in the at Network Rules. New rules default to Draft. Set a rule to Active before it intercepts traffic.

Rule structure

pre_tcp applies on macOS only. On Linux, pre_tcp is ignored. outputs is optional. Use it when the Formal Endpoint should forward traffic to the instead of evaluating policies locally. SSH ignores outputs. The Endpoint always connects SSH to the original destination, even when resource_name names an SSH resource. See SSH in Transparent Mode.

pre_tcp conditions

pre_tcp runs in the macOS Network Extension. It sees the connecting process, its ancestors, and the destination hostname and port. hostname comes from macOS flow metadata, falling back to the destination IP address. A matching pre_tcp condition does not intercept traffic by itself. Formal logs the flow and evaluates policy only when pre_tls and post_tls are also true. See Network rule inputs for the fields each stage can read. On macOS, this rule diverts traffic from a known agent or its children. It then intercepts MCP and LLM.
Use hostname and port in pre_tcp to filter destinations before diverting traffic. Put other destination checks in pre_tls. If other rules should see different processes, give each rule its own pre_tcp condition. Formal diverts a flow when any one of those conditions matches. Traffic from a process that matches no pre_tcp condition does not appear in Logs.

pre_tls conditions

pre_tls sees TCP flow metadata that Formal can collect without talking to the client process. That includes the destination hostname and port, the Unix process that opened the connection and its ancestors, and the user identity. If any pre_tls rule matches a TLS flow, Formal terminates TLS so it can inspect and forward plaintext. A TLS flow begins with a TCP ClientHello. Flows that do not start with a ClientHello, such as SSH, skip TLS termination. post_tls then classifies them from their first bytes. Exclude applications that do not trust the Formal certificate from pre_tls. This includes clients that do not use the system CA store, such as some Python scripts. Otherwise those clients raise CA trust errors.

post_tls conditions

post_tls receives the same inputs as pre_tls. Formal also classifies the plaintext wire protocol. You can include or exclude specific technologies. If pre_tls matches and no rule’s post_tls matches, Formal forwards the unchanged traffic. It does not log the flow or evaluate policy.

Process identity

On macOS, process.is_agent, the per-agent flags, process.has_agent_ancestor, and process.is_browser use code-signed process identity. On Linux, the agent flags match /proc comm of the installed binary. process.is_grok_bot, process.is_browser, and process.signing.* stay false on Linux. os is linux or macos. Every stage can read it.

Known agent identities

Formal recognizes these signed processes as agents. Each row requires an exact match for every listed identity field. Any accepts every code identifier. None requires an empty bundle identifier. A process from another signing team is not recognized.

Examples

This starting rule intercepts MCP and LLM on macOS and Linux. It matches known agents on both. On Linux it also matches known LLM provider hostnames, and pre_tcp is ignored.
On macOS, this rule intercepts MCP and LLM traffic from a known agent.
On macOS, this rule intercepts every flow from a known agent, including child processes it spawned. has_agent_ancestor is also true when the connecting process is the agent.
To limit that intercept to Codex Desktop, match the signed bundle ID on the process or an ancestor. See Restrict Codex Desktop to LLM and MCP. This rule intercepts AWS API traffic from the Claude Code CLI. It applies only to users in the Infra group.
On Linux, this rule intercepts traffic to known model-provider hostnames.
This rule intercepts every flow whose destination hostname and port match a Formal resource.
This rule intercepts SSH to hosts under example.com. The Endpoint evaluates SSH session policies on it.
Verify:
  1. Set the network rule to Active.
  2. Enable Transparent Mode: formal transparent-proxy enable
  3. Confirm it is running: formal transparent-proxy status
  4. Send matching traffic and confirm it appears in Logs.

Technology classification

Formal classifies the plaintext wire protocol after TLS terminates. Use the technology input only in the post_tls condition. It is not available in pre_tls or pre_tcp. technology supports these values:
  • http
  • mcp
  • llm
  • aws
  • gcp
  • postgres
  • mongodb
  • ssh
Use technology only in post_tls. A pre_tls or pre_tcp condition cannot read the classified protocol.

Network rule inputs

The Stages column lists where each input can be read. pre_tcp applies on macOS only. Prefer process for new rules. connection_process still works. The connecting process stays nested at connection_process.process. An input left out of pre_tcp is unset there, except the empty values noted below. A condition that reads an unset input does not match. is_llm_hostname and process.cmdline are empty in pre_tcp. technology is empty in pre_tcp and pre_tls. Do not negate an empty value. !is_llm_hostname matches every process.

Next Steps

Formal Endpoint

Install and enable Transparent Mode

Write Policies

Enforce rules on intercepted traffic