Join our Newsletter — 33% off our NHI Course
Architecture & Implementation

No_log

← Back to Glossary
By NHI Mgmt Group Updated November 2, 2026 Domain: Architecture & Implementation

No_log is an Ansible task setting that suppresses sensitive output from logs and task results. It reduces accidental disclosure, but it is not a full secrecy control because secrets can still appear in shell commands, surrounding variables, or other execution artefacts.

What No_log Changes in Ansible Output

No_log is a task-level logging safeguard, not a secrecy boundary. It prevents Ansible from printing sensitive values in task output and event logs, which reduces accidental exposure during normal automation runs, but it does not stop those values from existing in the command, environment, variable scope, callback data, or downstream execution artefacts.

That distinction matters because the main benefit is reducing disclosure surface, not removing the secret from the workflow. If a task already embeds credentials, tokens, private keys, or other sensitive material in a shell command or variable expansion, no_log can hide the result without eliminating the underlying exposure path.

Where No_log Fits in Automation Security

In practice, no_log belongs in the broader control stack for automation secrecy, especially when playbooks touch vault values, API tokens, passwords, or privileged command execution. It is most useful when sensitive values are needed transiently but should not be echoed into logs, callbacks, or job summaries that may be widely retained or centrally aggregated.

The setting is therefore best understood as output suppression. It helps keep routine observability from becoming a leakage channel, but it should be paired with careful variable handling, tight scoping, and an assumption that any value exposed to shell execution may still be recoverable elsewhere in the execution chain.

For readers who want the broader Ansible and AWX security context, NHIMG’s Ansible and AWX Security Guide covers how logging, credentials, role boundaries, execution environments, and secret handling fit together.

Common Failure Modes and Misunderstandings

The most common mistake is treating no_log as equivalent to secret management. It does not rotate secrets, constrain access, or prevent a task from leaking data through debug statements, shell history, environment propagation, callback plugins, or surrounding orchestration systems.

A second failure mode is overconfidence in partial suppression. A task can still expose structure, timing, failure context, or adjacent non-sensitive values even when the main payload is hidden. That can still be enough to aid troubleshooting, correlation, or adversarial inference in a heavily instrumented environment.

When to Use No_log Deliberately

Use no_log where a task necessarily handles sensitive material and the value does not need to be displayed for routine operations. The control is most appropriate for credential provisioning, secret retrieval, privileged execution, and other steps where logging the payload would create unnecessary disclosure risk.

It should be used deliberately, however, because suppressing output can also reduce diagnostic value during failures. Teams need a conscious balance between secrecy and debuggability, especially in pipelines where hidden output makes it harder to understand whether a task failed because of bad input, permissions, or downstream system behaviour.

Operational Implications for Logging and Review

No_log changes how teams review automation evidence. If logs are used for audit, incident investigation, or troubleshooting, then hidden content can create visibility gaps that must be understood in advance. That means the surrounding process should still record enough non-sensitive context to explain what happened without revealing the secret itself.

It is also a reminder that logging policy and secret handling must be designed together. The right question is not whether a task is hidden, but whether the execution path has any alternate disclosure route that still exposes the protected value.

Risk and Threat Considerations

Because no_log only suppresses selected output, the residual risk is secret exposure through adjacent execution artefacts, not through the log line alone. Attackers and insiders benefit when sensitive values appear in commands, variables, callbacks, or job metadata even if the primary task result is hidden.

Failure mechanism: A task suppresses standard output while the secret still traverses shell expansion, environment inheritance, debug output, or orchestration metadata, leaving another recoverable disclosure path.

Impact: Sensitive values can still be harvested for account takeover, privilege abuse, lateral movement, or unauthorized access, even when operators believe the task was fully concealed.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 addresses the attack and risk surface, while NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST SP 800-53 Rev 5AU-3 — Content of Audit RecordsNo_log affects what sensitive content is written to audit and task records.
AC-6 — Least PrivilegeNo_log is most effective when paired with minimal exposure of secrets during task execution.
Recommendation — Limit logged content so sensitive values are not recorded in task and audit output. Restrict who can view automation output and related execution artefacts.
CIS Controls v8CIS-8 — Audit Log ManagementThe setting changes how automation logs are managed and what sensitive data they retain.
Recommendation — Configure log handling to avoid retaining sensitive automation output.
OWASP Non-Human Identity Top 10NHI-02 — Secret LeakageNo_log is a direct control for reducing secret leakage from automation output.
NHI-07 — Long-Lived SecretsIf sensitive values persist in logs or artefacts, long-lived exposure increases compromise impact.
Recommendation — Suppress secret values in automation output and review for other leakage paths. Shorten secret exposure windows and avoid persisting them in execution artefacts.

Practitioner Guidance

Why practitioners should care: Treat no_log as a narrow disclosure-reduction measure, not as evidence that a task is safe to expose broadly. If the underlying step handles credentials or other sensitive material, review where else that data may be visible before relying on suppressed logs.

Common misunderstanding: A hidden task result does not mean the secret was never exposed. The practical test is whether the value appears anywhere else in the execution path, especially in shell commands, variables, or external logging integrations.

Practitioner takeaway: Use no_log to reduce accidental disclosure, but design the task so the secret is not unnecessarily present in the first place.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 2, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org