DocsRules

Modify

Rules

Rules change traffic as it flows through Akev. Open Rules (Ctrl/⌘ 2), click New rule and pick a template, or right-click any exchange in Traffic → Create rule.

How rules are evaluated

Rules are checked top to bottom (groups included; disabled rules and groups are skipped). Every rule has conditions (all must match; none = every request) and an action.

  • Modifier actions — Rewrite, Breakpoint, Delay, Throttle, Highlight, Script, TLS fingerprint — apply and then evaluation continues, so they stack (e.g. "add auth header to all *.api.com requests" + "mock /users").
  • The first terminal action — Passthrough, Map remote, Mock, Map local, Close, Reset, Timeout, WebSocket echo/reject — handles the request and stops evaluation.
  • If no terminal rule matches, the request is passed through to its real destination.

A rule can be limited to the first N matches (e.g. "once"). Every rule shows a live hit counter. Changes apply as you type (when valid) and can be undone with Ctrl/⌘ Z.

Conditions

Method · Host · Port · Path · URL · Protocol (http/https/ws/wss) · Query parameters · Headers · Cookies · Body text · JSON body (exact or partial) · Form fields · GraphQL operation name · Source (process/interceptor) · HTTP version · plus Any of / All of / Not groups.

Text conditions support equals, contains, starts with, ends with, glob and regex, with optional case sensitivity and negation. Host globs: * matches anything including dots (*.example.com). Path globs: * stays within one segment, ** spans segments.

Actions

Action Kind What it does
Passthrough terminal Forward to the real server, optionally rewriting request/response
Map remote terminal Forward to another server (e.g. production → http://localhost:3000), optionally stripping a path prefix and keeping the Host header
Mock terminal Reply with a fixed status, headers and body (text, JSON, base64 or a file read on every request)
Map local terminal Serve files from a local file or directory (with index file, fallback to upstream)
Close / Reset / Timeout terminal Simulate failures
WebSocket echo / reject terminal Accept & echo, or reject an upgrade
Rewrite modifier Method, URL find/replace, query params, headers (set/add/remove), body (replace, find/replace, JSON merge patch, JSON patch), response status/headers/body
Breakpoint modifier Pause before the request is sent and/or before the response is returned, edit, then resume
Delay modifier Add latency (with jitter)
Throttle modifier Limit download/upload bandwidth and add latency
Highlight modifier Colour matching rows in Traffic (and attach a note)
Script modifier Run JavaScript — see scripting. Pro
Pause WebSocket messages modifier Hold matching WebSocket messages (sent, received or both; optional payload pattern) to edit, drop or forward each one — see WebSockets
TLS fingerprint modifier Present Chrome's, Firefox's, Safari's or Edge's TLS ClientHello and HTTP/2 preface to the server (or Akev's native one, or the intercepted browser's own) — see upstream TLS fingerprints. Pro

Script and TLS fingerprint (with a browser profile) need Akev Pro or its 14-day trial. Without a licence, rules with these actions stay saved and editable, but don't apply. Every other action is free.

Import & export

Export rules as JSON (akev-rules.json) to share or commit them. Import Akev rule files or HTTP Toolkit .htkrules exports, either as a new group or replacing your rules. HTTP Toolkit rules Akev can't reproduce come in disabled, with a note; a few transforms (match and replace on the host, path or query, replacing all headers) and JSON-RPC responses become script rules, which need Pro to run. The CLI can load rules at startup: akev start --rules team-mocks.json.

Type to search guides, the CLI and the API.