ServicesAboutNotesContact Get in touch →
EN FR
Note

Security Posture for AI Agents

How to scope permissions, isolate environments, and treat always-on AI agents like OpenClaw as untrusted actors — practical security practices for data teams

Planted
dbtaidata quality

Always-on AI agents that interact with data infrastructure require the same security posture as any other automated system with production access. CrowdStrike has released enterprise detection tools specifically for OpenClaw. Microsoft’s security team recommends running it only in isolated environments. The Dutch Data Protection Authority described it as a “Trojan Horse” and warned against using it with financial records or access codes. For consultants handling client data across multiple organizations, treating always-on agents as untrusted actors with minimal permissions is the standard approach.

Principle of Least Privilege

The core security principle is the same one that applies to any service account: grant the minimum permissions required for the agent to do its job, nothing more.

For a dbt monitoring agent, that means:

  • Read-only access to production warehouses. The agent needs to run dbt test and read results, not modify production data. A read-only role on the production dataset is sufficient.
  • Write access only to development schemas. If the agent needs to create or modify anything (temporary tables for test execution, Elementary metadata tables), limit write access to a development or monitoring schema.
  • Dedicated service account. Never use your personal credentials. Create a service account with scoped permissions specific to the agent’s needs. If the agent is compromised, the blast radius is limited to what that service account can access.
  • No access to PII. If the agent posts results to Slack or other messaging channels, ensure it can’t access tables containing personally identifiable information. Even if the agent doesn’t intentionally share PII, an unexpected error message or verbose log could include sensitive values.

Credential Management

API key rotation. Rotate API keys on a regular schedule — monthly is a reasonable cadence for most setups. If an agent’s credentials are leaked or the machine is compromised, monthly rotation limits the window of exposure.

Environment variables, not config files. Store credentials in environment variables or a secrets manager, not in plaintext configuration files. If the agent’s configuration is stored in a git repository (which is common for infrastructure-as-code setups), credentials in config files will eventually be committed.

Separate keys per service. The agent’s warehouse credentials, Slack token, and AI API keys should each be independent. Compromising the Slack token shouldn’t grant warehouse access. Compromising the warehouse credentials shouldn’t grant the ability to post messages.

Network Isolation

The machine running the agent should be isolated from your primary workstation and from any machines that hold sensitive client data beyond what the agent needs to access.

In practice, this means:

  • Separate network segment. The agent machine sits on its own VLAN or subnet, with firewall rules that allow outbound connections to the warehouse and Slack API, and deny everything else.
  • No file system access to your main workstation. The agent machine shouldn’t be able to read files from your personal laptop or desktop. If the agent is compromised, it shouldn’t be a path to your other systems.
  • No inbound access. The agent initiates all connections. No SSH from the internet, no exposed ports. If you need to manage the machine remotely, use a VPN or zero-trust access solution.

For a solo consultant with a Mac Mini running OpenClaw at home, full network segmentation might be overkill. At minimum, ensure the agent machine doesn’t share credentials with your personal machines and doesn’t have access to file shares or network resources beyond what it needs.

The Client Data Problem

Consultants face a specific challenge: the agent may need access to multiple client warehouses, each with their own security requirements and data handling agreements.

Per-client credential scoping. Each client project should have its own service account and its own set of credentials on the agent. Don’t use a single service account that spans multiple clients.

Data handling agreements. Review your client contracts to determine whether running an AI agent against their warehouse is permitted. Some contracts explicitly prohibit third-party AI tools processing client data. Others require notification. This is a legal question, not just a technical one.

No client PII through messaging channels. Even if the agent has read access to tables containing PII, configure it so that query results, error messages, and summaries posted to Slack never include raw PII values. Aggregate, mask, or exclude columns that could contain sensitive data.

Monitoring the Monitor

An agent that monitors your data pipelines should itself be monitored.

Audit logging. Log every command the agent executes, every query it runs, every API call it makes. If something goes wrong — a permissions escalation, an unexpected query, a data access pattern that doesn’t match its purpose — the logs are your forensic trail.

Alert on anomalous behavior. If the agent normally runs 10 queries per day and suddenly runs 500, something is wrong. If it accesses a dataset it’s never accessed before, something is wrong. Set up basic anomaly detection on the agent’s own activity.

Regular access reviews. Quarterly, review what the agent has access to and whether it still needs that access. Client projects end. Warehouse schemas change. Credentials should be revoked when no longer needed.

The Trust Gradient

Think of AI agent trust as a gradient, not a binary:

Trust LevelWhat the Agent Can DoExample
ObserverRead-only queries, report results”Tell me if tests passed”
AnalystRead data, generate summaries, post to Slack”Summarize test failures”
OperatorRun dbt commands, write to dev schemas”Run dbt test on staging”
ContributorCreate branches, propose code changes”Fix the failing test”
DeployerMerge changes, run production builds”Deploy the fix to production”

Most monitoring setups should operate at the Observer or Analyst level. The Cascading Agent Pattern extends to Contributor by having the orchestration agent trigger a separate coding agent. Deployer-level trust — where an AI agent can independently merge and deploy to production — is a significant step that most teams should avoid until they have robust automated testing and rollback capabilities.

Operating at the lowest useful trust level and escalating only after validating agent behavior at the current level is the standard progression.