Try it free

Mask sensitive data in Live Debugger snapshots

  • Latest Dynatrace
  • How-to guide
  • 4-min read

Live Debugger Live Debugger captures the full runtime state of a non-breaking breakpoint, including variable values that your application is processing at that moment. Some of those values—passwords, tokens, API keys, email addresses, or payment data—should never be exposed to the person debugging.

Sensitive data masking rules let you declare which values Live Debugger Live Debugger must not collect. Matching values are replaced before the snapshot is created.

Masking is performed by OneAgent on your own host. Values that match a masking rule never leave your server or network, so they are not transmitted to or stored by Dynatrace.

How masking rules work

A masking rule has three parts: what it matches, how it matches, and what it replaces the value with.

Rule types

Rule typeWhat it matches

Redact by variable name

The name of the variable. When a variable name matches, its entire value is redacted, whatever that value contains.

Redact by regex

The variable value. Any part of a value that matches the regular expression is redacted.

The two rule types identify data differently: a name-based rule redacts a value because of what the variable is called, and a regex rule redacts it because of what the value contains. Use a regex rule when the data you need to protect is recognizable by its format rather than by a variable name.

Variable name matching

For a Redact by variable name rule, choose how the name is compared:

  • Equals—the name is exactly the input string. foo matches only foo.
  • Contains—the name includes the input string. foo matches myfoobar and foo123.
  • Starts with—the name begins with the input string. foo matches foobar and foo123.
  • Ends with—the name ends with the input string. foo matches myfoo and barfoo.

Replacement values

Redacted data is replaced with \*\*\* by default.

You can set a different replacement for each rule:

  • A custom string. A rule for the variable name secretKey with the replacement REDACTED turns secretKey:12345 into secretKey:REDACTED.
  • An SHA-256 hash of the original value. Use this when you need to tell two redacted values apart—for example, to confirm that the same token appeared in two different snapshots—without seeing either one.

Rule order

Rules are evaluated in the order they appear on the Sensitive data masking page, and the first matching rule wins. You can reorder them.

Define a masking rule

  1. Go to Settings > Observability for Developers > Sensitive data masking.
  2. Select Add rule.
  3. Set Name to a display name for the rule.
  4. Select the rule type, then enter the variable name and comparison type, or the regular expression.
  5. Set the replacement value.
  6. Save the rule, and reorder it if an earlier rule would match the same data first.

Masking and programmatic access

Because OneAgent applies masking, redacted data never leaves your network and is never ingested or stored in Dynatrace. A value that matches a rule is replaced in the snapshot itself rather than hidden when the snapshot is displayed.

Snapshot data that you retrieve with dtctl is redacted the same way it is in the Live Debugger Live Debugger app.

This matters when an AI agent or an automated workflow reads snapshot data on your behalf: the agent receives the masked value, not the original.

What masking does not do

  • Masking is not access control. It removes values from the snapshot. To control who can read the snapshots you do collect, see Set up Grail permissions for Snapshots.
  • Name-based rules do not inspect values. A credit card number stored in a variable named payload is not redacted by a rule matching the name creditCard. Use a Redact by regex rule when the value format, not the name, is what identifies the data.

Related topics

  • Live Debugger
  • Set up Grail permissions for Snapshots
  • Configure additional settings for Live Debugging
  • Personal data captured by Dynatrace
Related tags
Application ObservabilityLive DebuggerLive Debugger