How to Configure Devin ClickHouse Audit Log

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a devin clickhouse audit log by creating a dedicated database user. Then you track every query the AI agent runs in system log tables. Teams often give an AI agent a shared login with broad read rights. That choice creates risk when the agent scans tables with private customer data. A broad role also makes it hard to tell agent queries from human queries. Giving the agent its own role fixes this tracking gap right away. How to set up a devin clickhouse audit log ClickHouse manages

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You set up a devin clickhouse audit log by creating a dedicated database user. Then you track every query the AI agent runs in system log tables. Teams often give an AI agent a shared login with broad read rights. That choice creates risk when the agent scans tables with private customer data. A broad role also makes it hard to tell agent queries from human queries. Giving the agent its own role fixes this tracking gap right away.

How to set up a devin clickhouse audit log

ClickHouse manages users, roles, row rules, settings profiles, and quotas through SQL statements. First, you must turn on SQL access control on your database server. This step needs a storage folder path set on the server. It also needs at least one admin user with access management rights turned on. An admin user can only grant rights that they already hold themselves. Creating a new account for Devin also requires the user creation privilege.

When you create the user, you set how the account logs in. You can also limit which hosts the AI agent can connect from. Next, you assign default roles and specific user settings to that account. To keep data safe, you can grant read rights on specific columns only. If Devin only has rights on two columns, it can query just those columns. A query asking for other columns will fail right away. A wildcard select across all columns will also fail and return zero rows. It only works if the table holds just those allowed columns. You can also grant rights across tables that share a name prefix.

Once Devin logs in with its own account, the database tracks its work. Every query the agent runs shows up under its unique user name. Your team can then read the system query log to check every run. You can see when the agent ran a query and what it asked for.

What native roles solve and what they leave open

Native database roles and column grants solve the first part of access control. They decide who can log in and which columns that account may read. They also make sure the database records the right user name in logs. This setup stops an agent from reading restricted tables by mistake. It also gives security teams a clear record after a task finishes.

Audit Log Integrity + ClickHouse Access Management: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Still, static roles do not check what a query does in real time. Once an agent has read rights on a column, it gets every value inside. If an allowed column holds emails, phone numbers, or card numbers, the agent reads them. Static grants cannot rewrite matched fields in results before they reach the agent. Also, a role cannot pause a risky command to ask a human for approval. Native logs tell you what happened in the past. They do not block bad queries or mask sensitive text during the session.

Why agent sessions need finer controls

AI coding agents work fast and run many queries to fix bugs. When Devin explores a schema, it may pull sample rows to test code. If those sample rows contain national IDs, that data enters the agent prompt context. Column grants are all or nothing for each column you pick. Sometimes a developer or agent needs to see a column structure without raw data. Native database permissions cannot mask just the sensitive strings inside a text column. Teams need a way to inspect queries and mask fields in flight.

Check ClickHouse queries and result columns on the wire

ClickHouse users and row policies decide who connects. They do not check each statement on the wire or redact sensitive string columns in query results. With hoop.dev, you run an open-source proxy, a sidecar for your ClickHouse. It reads ClickHouse's native TCP protocol before queries run while ClickHouse stays in charge of login and grants.

Multi-statement queries and table mutations are split and checked by hoop.dev guardrails. Banned actions are refused with a native ClickHouse error. On returned rows, hoop.dev data masking rewrites String and FixedString columns that match your rules. The audit trail logs each query, table, and verdict. See the MIT-licensed source on GitHub.

Frequently asked questions

Why should Devin have its own ClickHouse user account?

A dedicated user account separates AI agent activity from human engineer queries. It lets you set strict column grants and track every agent query in logs.

What happens if Devin runs a wildcard query on a restricted table?

ClickHouse refuses a wildcard select when the user only has partial column grants. The database returns no data unless the table contains only the granted columns.

Can ClickHouse column grants hide emails inside a free-text column?

No, native column grants either allow or block the entire column. They do not rewrite matched fields like emails or card numbers inside query results.

The query runs. The emails stay hidden.