How to Configure Semantic Kernel CockroachDB Audit Log

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a semantic kernel cockroachdb audit log by turning on table logging. Next, you connect your AI app using a dedicated database role. Teams often give AI plugins broad database roles to move fast during early testing. These wide roles let the AI app read or change any table row. If a prompt goes wrong, the agent might pull sensitive data or drop records. How a semantic kernel cockroachdb audit log works Semantic Kernel runs AI agents that call custom plugins to finish user tasks. A d

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 semantic kernel cockroachdb audit log by turning on table logging. Next, you connect your AI app using a dedicated database role. Teams often give AI plugins broad database roles to move fast during early testing. These wide roles let the AI app read or change any table row. If a prompt goes wrong, the agent might pull sensitive data or drop records.

How a semantic kernel cockroachdb audit log works

Semantic Kernel runs AI agents that call custom plugins to finish user tasks. A database plugin lets the agent build and run SQL queries on your cluster. You first create a specific database role just for the AI agent. Then you grant that role read or write rules on target tables.

CockroachDB tracks activity when you turn on audit logging for those target tables. Each time the agent runs a query, the database writes an event entry. The database stores these log files on the local disk of each node. Security teams then ship those files to a central log tool for review.

This native flow links the database role to the SQL statements it ran. You can see which table the plugin hit and when the query happened. You also see the status of each query in the text log file.

What native logging solves and what it misses

Native audit logs help you pass basic checks by recording table hits. They show when the AI app role logged in and ran a query. If an agent alters a row, the log records the SQL text. This helps your team trace bad changes after an incident happens.

Still, native setup only checks who logs in at the start. It does not inspect what individual queries do while they are in flight. All users sharing the AI app appear as the same single database role. You cannot tell which human user or prompt triggered a bad database query.

Also, database audit logs only record the event after the query runs. They do not block a bad delete statement from running on a table. They also do not mask private data before it reaches the AI model. If a plugin selects emails, phone numbers, or card numbers, the model gets them. Data masking rewrites matched fields in results so raw values do not leak.

Audit Log Integrity + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Best practices for AI agent database roles

Start by splitting your AI plugin roles by the exact task they perform. Give read-only roles to plugins that only fetch facts for user answers. Never let a search plugin use a role that can write or delete rows. This simple step cuts down the risk of accidental data loss.

Keep sensitive tables out of the schema that the AI role can read. If the role has no permissions on a table, the query fails fast. You should also set strict row limits on the queries your plugins build. This stops an agent from dumping a whole table into a prompt window.

Review your cluster audit files often to spot strange query patterns early. Look for failed permission checks that show an agent tried to reach blocked tables. Pair these database logs with your app logs to trace the full user request. Adding runtime controls on top of native logs closes the gap on live queries.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Does the database audit log show which user prompt caused a query?

No, the database only sees the shared role used by the AI app. You must match app logs with database logs to trace the human user.

Can native database audit logs stop an AI agent from reading card numbers?

No, audit logs only write down what happened after the query finishes. To hide emails, phone numbers, or card numbers, you need runtime data masking.

Where does CockroachDB store the audit log entries?

The cluster writes audit events to log files on each node disk. Teams usually forward these local files to an external log analysis tool.

The query runs. The emails stay hidden.