Tag: Databases

  • Claw Patrol agent firewall puts action-level limits on AI agents

    Claw Patrol agent firewall puts action-level limits on AI agents

    The Claw Patrol agent firewall is an open source security layer for teams that want AI agents to touch production systems without handing them raw secrets or blank-check access. It sits between agents and services such as Postgres, ClickHouse, Kubernetes, GitHub, and Slack, then checks the actual request before it goes out.

    The short version

    • Claw Patrol keeps credentials outside the agent process and injects them only after a request passes policy checks.
    • The system can inspect HTTP method and body, SQL verbs and functions, and Kubernetes resources and verbs instead of stopping at a coarse network allowlist.
    • Risky requests can pause for an LLM judge or a human reviewer in Slack, a dashboard, or a webhook.
    • Teams can record real actions as JSON fixtures and run policy regression tests with clawpatrol test before changing rules.
    • The practical question is whether action-level security becomes a normal requirement for production AI agents.

    Claw Patrol agent firewall notes

    The Claw Patrol agent firewall is best understood as a policy checkpoint for live agent actions, not as another chatbot wrapper. It watches what the agent is about to send to production systems and decides whether that specific request deserves to pass.

    What happened

    Deno’s Claw Patrol project describes itself as “the security firewall for agents.” The idea is simple enough: agents route traffic through a gateway, and the gateway decides whether a specific action should be allowed, denied, logged, or sent for approval before it reaches the destination service.

    That distinction matters. OAuth scopes, IAM roles, and Kubernetes RBAC usually answer the access question: can this identity reach a service or resource? Claw Patrol is aimed at the next question: once the agent has a path to the service, what is it trying to do?

    The project gives concrete examples. A Postgres-capable agent may be allowed to run ordinary reads but blocked from calling functions such as pg_read_file, pg_read_binary_file, lo_get, or dblink_ routines. A Kubernetes agent may be allowed to inspect pods but forced through an LLM review before kubectl exec commands run. HTTP requests can be matched by method, path, headers, and body, then routed through custom approval logic.

    Claw Patrol can run as a gateway, join a gateway over WireGuard or Tailscale, or wrap a single agent process with clawpatrol run. The GitHub repository is MIT licensed and had 518 stars when checked for this brief.

    Why this is worth watching

    The Claw Patrol agent firewall points at a real gap in agent deployments. Prompt filtering and output scanning help, but they do not fully answer what happens when an agent already has a database password, a Kubernetes context, or an API token. A compromised or confused agent with those credentials can still make valid-looking calls.

    Moving the control point to the wire changes the shape of the problem. The agent can ask to do something, but the gateway can parse the request and make a second decision using operational facts: SQL verb, table name, Kubernetes namespace, HTTP route, request body, approval status, and prior policy tests.

    That is more useful than treating agent security as a model-only problem. It fits the way infrastructure teams already think: credentials, policy, logs, approvals, and regression tests. For readers tracking adjacent tools, the broader IT & AI archive is where we keep similar developer infrastructure briefs.

    What the discussion is missing

    I could not find a public Hacker News discussion tied to the Claw Patrol release. That absence is worth noting because the project raises the sort of questions operators usually pick apart in public: latency, failure modes, policy drift, coverage across protocols, and whether LLM approval adds a new weak point.

    The useful debate should be about boundaries. A gateway can stop a class of bad requests, but it still depends on accurate parsing, careful policy writing, and safe defaults when a reviewer or model is unavailable. Claw Patrol says human approval can time out closed, which is the right direction, but teams will need to test how that behaves during real incidents.

    There is also a deployment tradeoff. Routing an agent through WireGuard, Tailscale, NetworkExtension, or a per-process tunnel is cleaner than sprinkling checks through every tool call, but it adds another piece of infrastructure. Some teams will accept that cost for production agents. Others will keep agents away from production until the risk model is simpler.

    The practical read

    If your agents only run local coding chores, the Claw Patrol agent firewall may be more machinery than you need. The moment an agent can touch production data, customer communication, deployment systems, or cloud APIs, action-level controls start to look less optional.

    The first test is narrow: pick one dangerous action and see whether the policy can express it without blocking normal work. For a database, that might mean allowing read-only queries while denying filesystem-reaching functions. For Kubernetes, it might mean allowing inspection commands while pausing exec, deletes, and secret reads for review.

    The second test is operational. Check whether the audit log is clear enough to reconstruct what happened, whether recorded fixtures catch policy regressions, and whether approval timeouts fail closed. If those pieces work, the tool becomes more than an agent demo accessory. It becomes part of the production safety case.

    Sources

  • Shopify MySQL inventory reservations: 5 lessons

    Shopify MySQL inventory reservations: 5 lessons

    Shopify MySQL inventory reservations are a useful reminder that a database migration story can be less about raw speed than about removing awkward failure modes. Shopify moved checkout-time inventory holds from Redis into MySQL so reservations and the inventory ledger could live inside the same ACID transaction boundary. The interesting part is how much work it took around SKIP LOCKED, schema shape, isolation level, lock ordering, and connection visibility before the design held up at peak commerce traffic.

    The short version

    • Shopify’s old Redis reservation system handled concurrency, but Redis and the MySQL inventory ledger could not be claimed in one atomic step.
    • The MySQL design used one row per sellable unit, capped the available row pool at 1,000 per item/location pair, and relied on SKIP LOCKED to avoid waiting on rows another checkout had already taken.
    • The migration was not a blanket “MySQL beats Redis” claim. It worked because Shopify changed the data model, tuned transaction behavior, and instrumented the full checkout path.
    • The surprising bottleneck was connection hold time, not simply reservation query latency or database CPU.
    • Shopify says the system handled high-volume flash-sale traffic with writer CPU under 50% and reader CPU under 16% after cleanup and configuration changes.

    What happened

    Shopify published an engineering write-up explaining how it replaced a Redis-backed inventory reservation path with a MySQL design for checkout. The reservation step is the short hold that happens while a buyer is paying. If it is wrong, one buyer may purchase stock that no longer exists, or another buyer may be told an item is sold out when it is still available.

    The old Redis model used operations like DECR and INCR on quantity keys. That was fast enough for concurrency, but it split the reservation state from the MySQL inventory ledger. Once payment succeeded, Shopify had to update MySQL and clean up Redis without a single atomic transaction across both systems.

    The new design put reservations in MySQL. Instead of updating one quantity column for an item, Shopify represented sellable units as rows. A checkout that needs three units selects three rows, skips rows locked by other transactions, and moves the selected units inside the database transaction. That is the core of Shopify MySQL inventory reservations.

    Why this is worth watching for Shopify MySQL inventory reservations

    The practical lesson is that SKIP LOCKED is not magic dust. It only helped because Shopify changed the shape of the data. A single hot row with a quantity column still creates contention. A pool of unit rows gives MySQL something useful to skip.

    Shopify also bounded the row pool. Keeping one row for every unit everywhere would explode for high-stock items, so the system caps available rows at 1,000 per item/location combination and uses a replenishment process to refill the pool from the ledger. That detail matters. It turns a clever locking trick into a design that can survive real catalog size.

    The engineering work continued below the schema. Shopify moved the relevant transactions to READ COMMITTED to avoid gap-lock behavior that blocked replenishment, fixed deadlocks by enforcing a consistent table lock order, and batched multi-line carts with UNION ALL to reduce round trips. For readers who follow backend infrastructure, the broader IT & AI archive is useful because this is the kind of systems story where the headline undersells the operational work.

    What Hacker News readers are arguing about

    The public Hacker News submissions I found were quiet: low score, no comments on the linked discussion. So there is no meaningful community argument to summarize from that thread.

    That silence is still telling in a small way. This is not a flashy framework launch or a new database benchmark. It is an operations-heavy post about transaction boundaries, lock behavior, and connection pools. The missing debate is the one backend teams should have internally: whether a separate coordination service is buying enough simplicity to justify the consistency and operating cost it adds.

    If a team reads the Shopify story as “replace Redis with MySQL,” it will copy the least important part. The useful question is narrower: can the source of truth, the reservation state, and the failure recovery path sit inside one transaction without making the checkout path a bad neighbor for every other database workload?

    The practical read

    Shopify MySQL inventory reservations are worth reading before you add Redis, Kafka, or a custom lock service to a checkout path. The first check is not “which tool is faster?” It is “what state must change atomically, and where does that state live?”

    For builders, the migration suggests five concrete checks:

    • Model contention explicitly. If every buyer fights over the same row, the database choice will not save you.
    • Test the isolation level you actually need. Default settings can be wrong for a narrow high-throughput path.
    • Keep lock acquisition order boring and consistent.
    • Measure connection hold time by caller, not only query latency.
    • Roll out with shadow mode or dual writes when the old system is still the safer source of truth.

    The app-builder angle is straightforward: checkout reliability affects conversion. For commerce apps, marketplaces, and inventory plugins, a reservation bug is not a backend detail. It can become a canceled order, a support ticket, or a merchant who stops trusting the platform.

    Sources