· engineering

Control Request Body Retention and Redaction in Inspector

Learn how to control request body retention and redact sensitive payloads in Request Inspector when tunneling localhost traffic over HTTPS with InstaWormhole.

By InstaWormhole team, Engineering

Control Request Body Retention and Redaction in Inspector

Debugging HTTP traffic on a local development server gets much faster when you can see what actually arrived. Request and response bodies, though, often carry tokens, credentials, or personal data. This guide covers how the InstaWormhole request inspector handles bodies, what it removes before storing a request, and how to use replay without leaving sensitive data behind. Everything here comes from the InstaWormhole documentation.

Why Body Retention Matters

When you expose a local app over a tunnel, the public address answers anyone on the internet unless you protect it. Even during development, the payloads that arrive can look like production traffic:

  • Authentication and session material: bearer tokens, access keys, one-time codes, or signed session data.
  • Personal and customer data: form submissions, profile updates, support tickets, and order payloads.
  • Webhook payloads: third-party event deliveries that often include customer records and account identifiers.

The inspector documentation warns that request bodies can contain secrets your app sends, such as tokens or personal data, and advises keeping them only while you need them. Choosing whether to keep bodies lets you balance observability (seeing the exact payload behind a failing request) against data minimization (not leaving copies of sensitive payloads around).

How the Request Inspector Works

In the quick start, you run a local app (for example at http://localhost:3000), create a tunnel in the dashboard, sign in once, and run the connector. The documented commands are:

npx @instawormhole/connector login
npx @instawormhole/connector run --relay wss://relay.instawormhole.site --origin 127.0.0.1:3000 --stored-device --tunnel <tunnel id>

The dashboard fills in your tunnel id when you copy the command from Connect an app. Once requests arrive, choose Open request inspector on the tunnel. According to See the requests that reach a tunnel, the inspector lets you:

  1. See a list of requests, newest first, with method, path, status, and duration.
  2. Tell who answered: your app, or InstaWormhole itself with a code such as connector-unavailable or origin-failed.
  3. Read request and response headers, with sensitive values replaced by redacted.
  4. Filter by status class, method, path text, and time, add a note of up to 500 characters, and pin requests you want to keep in view.

A few boundaries are worth knowing:

  • The inspector records durable tunnels only. A quick address from the connector without --tunnel is not recorded.
  • Everyone who can see the tunnel in your workspace can read its inspector.
  • A tunnel records at most 10 requests a second. Requests beyond that are counted as not recorded.
  • Requests that the password prompt refuses, and requests for an unknown address, are not recorded.

Controlling Body Capture with Keep Bodies

Body capture is off unless you turn it on. In the inspector, choose Keep bodies and confirm the dialog, which explains that bodies can hold secrets and how long they are kept. When it is on, new requests keep the first 64 KiB of the request body and of the response body.

Turning body capture on or off needs a recent sign-in and is recorded in the workspace audit log. The setting applies to all plans, on durable tunnels.

What Gets Stored and for How Long

The documentation on what is kept about your traffic gives these figures:

DataHow longNotes
Request records in the inspector24 hours, and the newest 500 per tunnelDurable tunnels only. Sensitive header values and query values are removed before storage.
Request and response bodies24 hoursOnly if you turn on Keep bodies, and only the first 64 KiB of each. Bodies can contain secrets.

Pinned requests are not trimmed by the 500-request count, but they also expire after 24 hours.

When to Turn Body Retention On

Enable Keep bodies when payload contents are essential to the bug:

  • Validation errors: a client or webhook sender triggers a 400 or 422 and you need the exact fields sent.
  • Webhook debugging: you want to examine payload structure from an external integration without reproducing the flow by hand.
  • Response troubleshooting: your local handler returns an unexpected error body that explains a downstream failure.

When to Leave It Off

Keep body capture off when you only need routing information, or when traffic carries real tokens or sensitive records you do not need stored. This is also the safer default for shared workspaces, because everyone who can see the tunnel can read its inspector.

ScenarioKeep bodiesWhy
Checking route hits, status, and latencyOffThe request row answers these questions without stored bodies.
Debugging JSON fields or webhook payloadsOnYou can read the first 64 KiB of the request and response.
Traffic with live tokens or personal dataOffNothing from the body is stored.
Replaying with edited body fieldsOnThe replay dialog shows the body only if it was kept.

What the Inspector Redacts, and What It Does Not

This is the most important point in the article: bodies are not redacted. The documentation states that this is why they are off unless you turn them on. Redaction applies to other parts of the request, and it happens in the relay before anything is stored:

WhatHow it is handled
Header values for authorization, proxy-authorization, cookie, and set-cookieReplaced with redacted
Header names containing token, secret, password, session, api-key, apikey, auth, or keyReplaced with redacted
Query string values in the pathReplaced; the keys stay
The sender’s full addressOnly the first part is kept: the /24 for IPv4 or the /48 for IPv6

Because redaction happens before storage, a redacted value cannot be shown later. Two practical consequences follow:

  1. Do not treat redaction as a substitute for safe test data. A secret placed in a request body is stored as sent when Keep bodies is on. Use mock tokens and dummy personal data when testing.
  2. Do not put secrets in query strings expecting to see them later. Query values are replaced, so a token in the address is not stored. That protects the secret, but it also means you cannot recover it from the inspector.

Replaying a Captured Request

The replay guide describes how to send a captured request to your app again after fixing a bug. Select the request and choose Replay. A dialog shows the method, path, headers, and, if it was kept, the body. You can edit them, and a warning appears for methods that change data, such as POST.

When you confirm, the request goes to the tunnel’s public address and your app. It is marked with an X-Instawormhole-Replay header. You can replay once every 5 seconds, and each replay is recorded in the workspace audit log.

Keep these limits and precautions in mind:

  • Side effects: replaying a request that creates or changes something, such as a payment or an order, can do that again.
  • Passwords: replay is not available on a tunnel with a password, because InstaWormhole never holds the password. Use Copy as cURL and add the password yourself.
  • WebSockets: replay is not offered for WebSocket requests.
  • Redacted values stay redacted: if your endpoint needs a real authorization header or similar value, you will need to supply a fresh test value yourself.
  • Exports: Copy as cURL and Download HAR are made in your browser from the stored request, so redacted values stay redacted, and a review step lists what was removed.

A Safer Workflow

Step 1: Decide Who Can Reach the Tunnel

When you create a tunnel, you pick an expiry (Never, In 1 hour, In 1 day, In 7 days, or In 30 days) and who can open it: Anyone with the address, or Only people with a password if your plan includes password protection (Starter and up). Remember that replay is unavailable on password-protected tunnels, so decide which matters more for the session.

Step 2: Turn On Keep Bodies Only While Investigating

Open the inspector, choose Keep bodies, send the request that reproduces the bug, and read the body in the request detail.

Step 3: Replay Deliberately

Review the dialog, edit what you need, and confirm. Check that your local state can handle a repeated request.

Step 4: Turn It Off and Clean Up

Choose Stop keeping bodies when you are done. New requests then keep no bodies, but bodies already stored stay until they expire after 24 hours, or until you delete the requests. To remove them sooner, delete individual requests or choose Delete all in the inspector. Deleting a tunnel removes its request records and any held requests. Finally, stop the connector with Ctrl+C when you finish sharing your app.

Held Webhooks Are Stored Differently

If you use the webhook inbox to hold webhooks while your tunnel is offline, the rules differ from the inspector. According to Hold webhooks while your tunnel is offline:

  • A held request keeps the full request, including headers and body, in unencrypted storage until it is delivered or reaches its holding time. It may contain personal data or credentials the sender included.
  • Held requests are kept for 24 hours on Starter and Pro, and 72 hours on Team and Business.
  • Up to 100 requests are held per tunnel, and one request body can be up to 64 KiB.
  • Only POST, PUT, and PATCH requests to the paths you list are held, and the tunnel must have no password and no token.
  • When a request is delivered, fails, or expires, its headers and body are deleted. A short record without content stays for 24 hours.

Common Pitfalls

  • Assuming a tunnel is private: the public address answers anyone on the internet unless you protect it.
  • Assuming bodies are scrubbed: headers and query values are redacted, but bodies are not.
  • Replaying side-effecting requests: a replayed POST can create the same record again, so reset your local test state when needed.
  • Forgetting that stored bodies outlive the switch: turning capture off does not delete bodies already stored.
  • Leaving the connector running: while it runs, requests to the address reach your app. Stop it when you finish.

Quick Checklist

PracticeAction
Access controlChoose an expiry and, on supported plans, a password before sharing.
Body retentionTurn on Keep bodies only while debugging; use Stop keeping bodies afterward.
Test dataUse synthetic tokens and personal data, since bodies are not redacted.
CleanupDelete requests you no longer need; stored bodies otherwise expire after 24 hours.
ReplayReview the dialog, expect redacted values to stay redacted, and watch for side effects.
Session endStop the connector with Ctrl+C.

For complete details on tunnel setup and traffic handling, see the official InstaWormhole documentation.