Class SecretRedactor
java.lang.Object
com.inductiveautomation.ignition.gateway.config.SecretRedactor
Strips secret values out of configuration JSON before it is shown to an AI agent.
Redaction preserves structure: a field holding a secret keeps its name and stays present with
the placeholder REDACTED as its value, so a reader can tell that a secret is
configured without learning what it is. Values that identify where a secret lives — the
provider and secret names of a secret-provider reference — are left intact, because they are
useful grounding and are not themselves sensitive.
Use this on every configuration element that leaves the gateway for a model:
JsonElement safe = SecretRedactor.redact(jsonCodec.encodeToJson(decoded.config()));
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic com.inductiveautomation.ignition.common.gson.JsonElementredact(com.inductiveautomation.ignition.common.gson.JsonElement element) Returns a redacted copy of the given element.static com.inductiveautomation.ignition.common.gson.JsonElementredact(com.inductiveautomation.ignition.common.gson.JsonElement element, Set<String> additionalSensitiveKeys) Redacts with additional field names supplied by the caller, for a resource type that stores a secret in a field this class has no business knowing about.
-
Field Details
-
REDACTED
-
-
Method Details
-
redact
public static com.inductiveautomation.ignition.common.gson.JsonElement redact(com.inductiveautomation.ignition.common.gson.JsonElement element) Returns a redacted copy of the given element. The argument is never modified, and the result shares no mutable state with it.- Parameters:
element- the configuration JSON to redact; may be any kind of element, including a bare primitive orJsonNull.- Returns:
- a copy with every embedded secret and every sensitively-named string value replaced by
REDACTED.
-
redact
public static com.inductiveautomation.ignition.common.gson.JsonElement redact(com.inductiveautomation.ignition.common.gson.JsonElement element, Set<String> additionalSensitiveKeys) Redacts with additional field names supplied by the caller, for a resource type that stores a secret in a field this class has no business knowing about. A name that is a credential in one resource type may be innocuous in another, so these stay with the caller.- Parameters:
element- the configuration JSON to redact; never modified.additionalSensitiveKeys- field names to blank in addition to the shared list, matched case-insensitively.
-