Because the risk shifts from visibility to invocation. A model may never see the secret, yet it can still cause a tool to use that secret on its behalf. That means access control, execution policy, and logging are more important than prompt sanitisation alone when governing agentic workflows.
Why AI agents increase secrets risk even without prompt exposure
AI agents change the attack surface because the secret no longer needs to be visible to be useful. If an agent can call tools, request actions, or trigger workflows that already carry privileged context, it can effectively invoke a credential without ever reading it. That makes prompt sanitisation insufficient on its own. The practical question becomes whether the agent is allowed to cause a secret-bearing action, under what conditions, and with what traceability.
This is especially important in workflows where a model is treated as a planner and a downstream service as the executor. In those setups, the secret lives in the tool layer, but the decision to use it can originate in the model layer. The result is a trust boundary mismatch: the organisation protects the text input while leaving the action path largely implicit. NHIMG research on secret sprawl shows how fragmented secret handling and weak practice create durable exposure even before AI is involved.
For readers mapping this to current guidance, the Guide to the Secret Sprawl Challenge is useful because it frames the operational conditions that make secret misuse easier once agentic systems are introduced. In practice, many teams discover this only after an agent has already triggered an allowed action, not while reviewing the prompt.
How invocation risk works inside agentic workflows
The core mechanism is delegation. A human configures a workflow, a model interprets the task, and a tool or service executes an operation using credentials that the model itself never directly sees. If the agent can decide when to search, send, deploy, approve, or retrieve, then it can indirectly steer the use of secrets through tool calls, workflow steps, and function outputs.
That is why the main control problem is not just protecting the secret value. It is limiting what an agent can cause a privileged integration to do. In mature setups, teams separate the workload identity of the agent from human identities, assign narrow tool scopes, and treat secret access as an explicit authorization decision rather than a hidden implementation detail. JIT access and short-lived credentials also matter because they reduce the value of any single successful invocation.
- Keep secrets out of prompt-visible context, but do not assume that alone is protection.
- Bind tool permissions to a workload identity with narrowly scoped actions.
- Prefer ephemeral credentials where the agent only receives the access needed for the current task.
- Log both the decision to call a tool and the downstream use of any credentialed action.
The relevant external control model is the OWASP Top 10 for Agentic Applications 2026, which addresses agent-specific failure modes rather than generic prompt hygiene. These controls tend to break down when tool permissions are broad, credentials are long-lived, and execution paths are opaque to monitoring.
Common variations and edge cases in secrets handling
Tighter secret isolation often increases operational friction, because every useful action has to be explicitly authorised, bound to a scope, and logged. The tradeoff is real: stronger boundaries can slow automation if teams try to preserve the convenience of unrestricted tool access while also demanding low risk.
One common edge case is the “secretless prompt, secretful side effect” pattern. The model never handles credentials, but it can still cause a system to send an email, query a database, or deploy code using a stored token. Another is when a shared service account or cached session sits behind many agent actions, making attribution weak even when the initial prompt is harmless. Current guidance suggests treating those cases as control-design problems, not prompt-filtering problems.
For NHI governance, the distinction between static and dynamic secrets matters more in agentic systems than in conventional chat use. Dynamic credentials limit dwell time and reduce reuse risk, while static secrets create a durable path for repeated invocation abuse if the agent or its tools are manipulated. For readers wanting a deeper NHI-specific baseline, Ultimate Guide to NHIs — Static vs Dynamic Secrets extends this distinction in practical terms.
Where this guidance breaks down is in highly integrated environments where multiple tools share the same backend credential or where the agent can chain benign actions into a privileged outcome faster than logging and review can keep up.
Risk and Threat Considerations
The material risk is privilege transference: an attacker or faulty prompt can steer an agent into causing a secret-bearing action without ever obtaining the secret itself. That makes hidden execution paths, shared service accounts, and overbroad tool scopes attractive targets because they let a low-trust instruction produce a high-trust effect.
Failure mechanism: The weakness materialises when the agent can trigger a downstream service that already has authenticated access. The secret remains protected at rest, but the control failure lies in authorising the action path. Abuse can occur through prompt injection, task redirection, or workflow chaining that causes the agent to call a privileged tool outside the operator’s intent.
Impact: Sensitive actions may be executed, data may be accessed or exfiltrated, and audit trails may show only that a legitimate service account acted. That weakens accountability, complicates incident response, and can turn one compromised agent into repeated privileged operations.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Agentic AI Top 10, OWASP Agentic AI Top 10, OWASP Non-Human Identity Top 10 and CSA MAESTRO address the attack and risk surface, while CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Agentic AI Top 10 | A2 | Agentic tool calls can invoke secrets-backed actions without exposing the secret. |
| Recommendation: Limit agent tool effects so privileged actions cannot be triggered outside intended scope. | ||
| OWASP Agentic AI Top 10 | A1 | Prompt manipulation can redirect agents into secret-bearing actions through tools. |
| Recommendation: Treat prompt injection as a path to unauthorized execution, not just bad text output. | ||
| OWASP Non-Human Identity Top 10 | NHI-01 | The question centers on secrets risk from indirect agent invocation and credential use. |
| Recommendation: Prefer short-lived, tightly scoped secrets and minimize reusable credential exposure. | ||
| CSA MAESTRO | T1 | Agent workflows need identity-bound, scoped access to prevent indirect secret abuse. |
| Recommendation: Bind agent actions to controlled identities and enforce least privilege on every tool path. | ||
| CIS Controls v8 | 6.3 | Indirect secret use is reduced by limiting who and what can exercise privileged access. |
| Recommendation: Grant only the access required for each workflow and remove standing privilege where possible. | ||
Practitioner Guidance
What to prioritise: Prioritise the tool path, not the prompt path. If a model can cause a secrets-backed action, assess the authorization boundary around that action before debating whether the prompt was clean.
What to verify: Verify that each agentic workflow has a distinct workload identity, a narrowly scoped permission set, and a log entry for both the trigger and the resulting privileged operation. If those three elements are not separable, the workflow is too opaque for safe delegation.
Decision rule: If the secret can authenticate to production, treat any agent that can influence its use as a privileged actor and require JIT or other short-lived access by default. If the only safeguard is prompt filtering, the control is incomplete.
Practitioner takeaway: The security boundary in agentic systems is usually the action, not the text. Teams that govern invocation, scope, and attribution can safely use agents; teams that focus only on prompt hygiene usually discover the real exposure after the first unintended tool call.
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on September 6, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org