Imperium — AI Governance & Control

The Query Was Read-Only. The Password Was Exposed.

An AI agent can complete an authorized task and still create a security incident along the way.

Moshe Sharon6 min readAI Governance · Imperium

READ-ONLY. STILL EXPOSED. An agent terminal runs a read-only curl query with a fictional demo credential; a thin red trace links the credential to the same value in a process list captured during execution. Statuses read TASK SUCCEEDED in green and CREDENTIAL EXPOSED in red.
The query completed and modified nothing, but the credential passed on the command line was visible in the process list while it ran. Demo credential; all identifiers fictional.

The instruction was ordinary: investigate a database.

The agent connected to the server, ran read-only queries, and returned its findings. It did not delete records, change permissions, or modify the application.

Yet its own follow-up report described a problem: the database password had been passed directly in the command line. While the query ran, that credential could have been visible through process inspection to users with sufficient access on the host.

The query worked. The execution method exposed a secret.

That distinction matters as AI agents take on more operational work. Checking whether an agent was authorized to query a database does not establish whether it handled the database credential safely.

A successful task with a security consequence

In an internal agent conversation we reviewed, an agent reported that another agent had briefly exposed a ClickHouse password while running read-only queries. It then checked the host's process visibility and local accounts, and confirmed that a temporary helper script was no longer present.

Screenshot of the agent's investigation report, finding 5: Credential exposure during read-only queries. The query helper read the ClickHouse credential from a protected configuration file and passed it to curl as a command-line argument (curl -u audit_reader with the password redacted). While each query ran, the password was visible in the process list to local users; this does not establish that anyone captured or used it. The temporary helper and SQL files were deleted; no database configuration, service or data was changed. Recommendation: rotate the password with the owner's approval and use a credential mechanism that does not expose the secret in process arguments. Read-only queries do not make credential handling safe.
The agent's own report of the finding. Password redacted.

The report was useful. It acknowledged the exposure and proposed changing the password with a coordinated service update.

But it also illustrates how easily reassurance can outrun evidence.

A list of accounts does not prove who inspected a process while it was running. The absence of a temporary script does not establish whether a command was captured elsewhere. And a brief exposure is still an exposure, even when there is no evidence that anyone used the credential.

The defensible conclusion is narrower: a secret was reported as exposed through a particular execution path; access and retention need investigation; misuse has not been established.

This is a recognized class of weakness. MITRE describes sensitive information exposed through process invocation as CWE-214. Actual visibility depends on operating-system permissions and configuration. [1]

Three ordinary ways secrets cross the wrong boundary

The following scenarios illustrate documented exposure mechanisms. They are not claims about three publicly reported AI incidents.

1. The password becomes a process argument

An agent needs to inspect a database. It retrieves a credential and constructs a command that includes the password as an argument.

The database request succeeds. However, the secret has now entered process metadata, where other sufficiently privileged processes or monitoring systems may be able to observe it. [1]

An approval that says “allow database queries” is too broad to catch this distinction. The required control concerns credential handling at the point of execution.

The safer path is an approved credential mechanism supported by the client: for example, a restricted configuration file, a file descriptor, or a credential broker. The exact mechanism must be validated for the tool. Moving a secret into an environment variable is not a universal guarantee of safety.

2. A diagnostic step puts a token into the CI log

An agent troubleshoots a failed integration. It enables verbose output or prints a generated request to understand what happened. A newly generated authentication token appears in the diagnostic output.

The agent solves the integration problem. The log now contains a credential.

GitHub's security guidance warns that secrets can reach standard output or error logs, and that generated tokens need appropriate masking. Masking must be established before output occurs; it does not undo an earlier disclosure. [2]

The control therefore needs to cover both the action and its output: avoid emitting authentication material, register required masking before use, and inspect output before it enters shared logs or an agent's conversation history.

3. “Sensitive” output becomes a shared troubleshooting artifact

An agent investigates an infrastructure problem and collects Terraform state or machine-readable outputs into a support bundle. It assumes values marked sensitive will remain hidden.

HashiCorp documents that sensitive values can remain in state and plan files. It also explains that certain machine-readable output commands reveal sensitive outputs in plaintext. [3]

The diagnostic bundle may now carry database passwords or API tokens into a ticket, shared directory, or another agent's context.

Here, the decision cannot stop at whether the agent may run Terraform. It must also consider which artifact was produced, what it contains, and where it is about to go.

Why a green automation result is insufficient

All three scenarios can end with a successful task.

  • The query returns rows.
  • The integration starts working.
  • The infrastructure issue is diagnosed.

An operational success indicator can accurately describe those outcomes while saying nothing about the credential exposure created along the way.

This gives us two separate questions:

  • Did the process achieve its intended result?
  • Did it execute within the organization's security and handling rules?

Both answers belong in the record. A task that completed with an unresolved credential exposure should remain visible as such.

Where an AI control plane needs to act

This is the control boundary we are building toward with Imperium: policy applied to agent actions, tool use, and sensitive information as work moves through an organization.

For these examples, effective prevention requires an enforcement point in the actual execution path. A system that sees only model prompts cannot reliably prevent a command launched outside its control.

A controlled tool gateway or endpoint integration can evaluate a proposed action before execution, restrict credential delivery, and apply output handling before results are persisted or forwarded. Coverage needs to include delegated agents and remote execution paths as well.

Where that coverage is absent, the interface should say so. Detection after an action and prevention before an action are different capabilities.

The resulting event should identify the agent, tool, target, policy decision, and handling outcome without copying the exposed secret into another dashboard.

Observatory supplies the investigation context

Imperium's policy decisions also need operational context.

Observatory's AFPM should connect the event to the execution: which agent invoked the tool, which parent task delegated the work, whether retries followed, whether the business outcome was verified, and whether remediation remains open.

An execution could therefore have a verified successful outcome and an unresolved security finding at the same time.

That is a more useful account than compressing both into a single green or red indicator.

Recovery needs evidence too

Once a credential has been exposed, deleting the command or helper script does not by itself establish containment.

Response may require identifying the credential's permissions, investigating possible exposure locations, replacing or revoking it, updating dependent services, and verifying that the old credential no longer works. The sequence depends on the service and its availability requirements.

The record should distinguish an exposure from confirmed misuse, and a proposed remediation from a completed, verified one.

An agent's acknowledgment is useful. An independently checked recovery gives operators something stronger to rely on.

As agents gain access to more systems, organizations need to assess the path taken as carefully as the result returned.

Sources

Tracston works on these questions in Imperium and Observatory.