Hide system prompts and tool definitions
Replace your system prompt and tool definitions with a fingerprint in the data your application sends to AIO. You can still tell prompt versions apart, but the text never leaves your application.
What changes
Each setting is off by default. Only the recorded copy changes. Your model still gets the full request, including the system prompt and tool definitions.
Setting | What AIO receives |
| The system instructions ( |
| The tool definitions ( |
A fingerprint is sha256: followed by the 64-character hex SHA-256 hash of the original value, for 71 characters in total. The hash isn't salted, so the same prompt always produces the same fingerprint. If two traces have the same fingerprint, they used the same prompt. A different fingerprint means the prompt changed.
Prerequisites
- The Python SDK is installed and your credentials are configured. For more information, see Instrument your code.
Hide them in code
- In your application's startup code, pass a policy to
aio.initwithredaction=aio.redaction_policy(...). - Set
hide_system_instructions=True,hide_tool_definitions=True, or both. - Call
aio.initonce, before you create any HTTP or model clients.
import acceldata_aio_tracer as aio
aio.init(
redaction=aio.redaction_policy(
hide_system_instructions=True,
hide_tool_definitions=True,
),
)
# Create your HTTP and model clients after this point.
aio.init returns True when telemetry is running. Only the first call takes effect. A second call returns True but doesn't apply a new policy, so set the policy in the first call.
Hide them with environment variables
- Set
AIO_HIDE_SYSTEM_INSTRUCTIONS,AIO_HIDE_TOOL_DEFINITIONS, or both totrue.
export AIO_HIDE_SYSTEM_INSTRUCTIONS=true
export AIO_HIDE_TOOL_DEFINITIONS=true
- Call
aio.initwithout theredactionargument.
Only 1, true, yes, and on turn a setting on. Case doesn't matter, and spaces around the value are ignored. Any other value, including a typo, leaves the setting off.
Important
AIO reads these variables only if you don't pass redaction to aio.init. If you pass a policy in code, AIO ignores these variables completely. It doesn't combine them with your policy.
Check the result in a trace
- Open a trace that your application sent after you turned on the setting. For more information, see Explore traces.
- In the waterfall, select the step for the LLM call. The step detail pane opens.
- Above Input, find the System instructions block. When the prompt is hidden, its header reads
71 characters, which is the length of the fingerprint. - Expand System instructions. The block tells you that only the prompt's fingerprint was exported and that the text wasn't captured. It doesn't show a Copy button.
If the block shows your prompt text and a Copy button instead, the setting wasn't on when the trace was recorded.
Troubleshooting
aio.init raises RedactionUnavailable
If your application sets up OpenTelemetry before it calls aio.init, AIO can't hide the content. So it doesn't start, and it raises RedactionUnavailable with this message:
aio: redaction is configured, but this application already set up an OpenTelemetry TracerProvider. Redaction is applied by the span exporter, which that provider does not use, so span content would be exported unredacted. Call aio.init() before configuring OpenTelemetry.
- Move the
aio.initcall so that it runs before your OpenTelemetry setup. For more information, see OpenTelemetry.
The prompt text still appears
- Check the environment variable values for typos. Any value other than
1,true,yes, oronleaves the setting off. - If you pass
redactiontoaio.init, set the switches in that policy. AIO ignores the environment variables when you pass a policy. - Make sure the policy is set in the first call to
aio.init. Later calls don't apply a new policy.

Have a suggestion?