How to Configure PlanetScale Audit Log

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a planetscale audit log in the admin settings for your team. This log tracks control plane changes like new branches, role updates, and password creation. Most teams turn on these native logs first to meet basic security rules. Still, teams often grant broad admin roles so developers can move fast. Broad roles make it hard to stop risky queries before they run. How the planetscale audit log works in your setup PlanetScale gives teams a central place to check account events and admi

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 planetscale audit log in the admin settings for your team. This log tracks control plane changes like new branches, role updates, and password creation. Most teams turn on these native logs first to meet basic security rules. Still, teams often grant broad admin roles so developers can move fast. Broad roles make it hard to stop risky queries before they run.

How the planetscale audit log works in your setup

PlanetScale gives teams a central place to check account events and admin actions. When an admin sets up logging, the platform records who made a control change. It logs events when someone creates a database branch or approves a deploy request. It also records when a user generates a new password or changes team roles.

Teams can view these records in the web dashboard or export them out. Many security teams send these event streams to a central log tool for review. The native log ties each control action to a specific user account and time. This setup works well for tracking changes to your database setup and team settings. You get a clear list of every branch merge and role update.

What native audit logs miss during live database sessions

Native platform logs focus on control actions rather than live data queries. They tell you who generated a database password and when they did it. They do not show every SQL statement that runs using that shared password later. Once a developer or app has a valid password, the control log steps back.

A single shared role can run thousands of read and write queries every hour. If two engineers share one connection string, the log cannot tell them apart. You know who created the password, but not who ran a drop table command. Native control logs also do not mask sensitive fields inside query results.

When a user queries customer tables, raw emails and phone numbers return in full. Data masking must rewrite matched fields like card numbers or national IDs in results. Also, native logs record events only after the action has already happened. They cannot pause a dangerous delete statement and ask a manager for approval first.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

How to plan roles and log rules for database teams

Start by cutting down the number of people who hold full admin roles. Give developers branch roles for daily work instead of full production rights. Review your planetscale audit log every week to spot unused passwords and old roles. Delete old connection keys right away so nobody can use them in secret.

Next, map out which tables hold sensitive user data like emails or card numbers. Decide which team members need to run direct queries against production branches. Separate your automated app roles from the roles that human engineers use for debugging. When humans need to run a fix, track each query back to one person. Pair your control plane logs with query-level checks to cover both setup and data.

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 sits inline in the wire protocol beside those services as an open-source proxy, a sidecar for your Postgres or API. On every query an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run, and hoop.dev data masking rewrites matched sensitive values in responses 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 planetscale audit log record every SQL query?

No, the native audit log tracks account and control plane actions like branch creation. To record every individual SQL statement and user identity, you need query-level logging.

How can teams protect sensitive data during live queries?

Teams use dynamic data masking to rewrite matched fields in query results. This replaces raw emails, phone numbers, and card numbers with masked text during queries.

Why is sharing database passwords risky for audit logs?

Shared passwords hide which specific person ran a query during a database session. Tying each session to an individual identity lets you see who ran every command.

The query runs. The emails stay hidden.