English | 简体中文
LoongSuite Pilot can mask common secrets before normalized events are sent to output backends. Use this when prompts, completions, tool arguments, or tool results may contain credentials.
Masking is separate from message content capture:
captureMessageContent: falsereduces whether full message or tool content is collected.maskscans configured output fields and replaces high-confidence secrets that are still present.
For sensitive environments, use both.
Config file:
{
"mask": {
"mode": "all"
}
}Or, Environment variable:
export LOONGSUITE_PILOT_MASK_MODE=allRestart Pilot after changing config:
loongsuite-pilot restart| Mode | Behavior |
|---|---|
none |
Do not mask fields. This is the default when no mask mode is configured. |
all |
Enable all built-in sensitive data rules. |
custom |
Enable only the mask types listed in mask.types. |
| Type | What It Covers |
|---|---|
cloudAccessKey |
Alibaba Cloud, AWS, and Tencent-style access key IDs. |
apiKey |
OpenAI-compatible and GitHub-style API keys. |
privateKey |
PEM or OpenSSH private key blocks. |
databaseUrl |
Database URLs with embedded passwords. |
Custom mode example:
{
"mask": {
"mode": "custom",
"types": ["apiKey", "databaseUrl"]
}
}Equivalent environment variables:
export LOONGSUITE_PILOT_MASK_MODE=custom
export LOONGSUITE_PILOT_MASK_TYPES=apiKey,databaseUrlWhen a rule matches, Pilot replaces the secret with a fixed marker:
| Mask Type | Replacement Marker |
|---|---|
cloudAccessKey |
[ACCESSKEY_MASKED] |
apiKey |
[APIKEY_MASKED] |
privateKey |
[PRIVATEKEY_MASKED] |
databaseUrl |
[DATABASEURL_MASKED] |
The original value is not preserved in the emitted event.
Masking runs in the collector before events are written to JSONL, SLS, HTTP, or OTLP trace output.
Pilot focuses masking on fields that may contain user or tool content, such as:
- LLM input and output messages.
- Tool call arguments.
- Tool call results.
- Known agent-specific content fields, such as
agent.content,agent.inline_diff_message, and selected compact content fields.
Stable metadata such as model names, token counts, durations, Git branch, and workspace path is not intended to be scanned as secret-bearing content.
- Enable JSONL output and masking.
- Restart Pilot.
- Trigger an agent event that contains a known test secret pattern.
- Inspect local output:
tail -f ~/.loongsuite-pilot/logs/output/*.jsonlExpected output should contain mask markers such as [APIKEY_MASKED] instead of the original secret.
- See Local JSONL Output, SLS Output, Trace Output, and HTTP Output for output backend setup.
- See Output Event Schema for fields marked as opt-in sensitive content.