<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Access Control on RockB</title><link>https://baeseokjae.github.io/tags/access-control/</link><description>Recent content in Access Control on RockB</description><image><title>RockB</title><url>https://baeseokjae.github.io/images/og-default.png</url><link>https://baeseokjae.github.io/images/og-default.png</link></image><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 16 Nov 2026 00:10:00 +0000</lastBuildDate><atom:link href="https://baeseokjae.github.io/tags/access-control/index.xml" rel="self" type="application/rss+xml"/><item><title>Read-Only Debugging Agents for Production: A Capability Envelope You Can Audit (2026)</title><link>https://baeseokjae.github.io/posts/hyperprobe-readonly-debugging-agents-2026/</link><pubDate>Mon, 16 Nov 2026 00:10:00 +0000</pubDate><guid>https://baeseokjae.github.io/posts/hyperprobe-readonly-debugging-agents-2026/</guid><description>Read-only is four separate controls, and only three are enforced by the system rather than by the agent&amp;#39;s own behaviour. How to draw the capability envelope, where each layer leaks, and which fields make a debugging session auditable after the fact.</description><content:encoded><![CDATA[<p>An agent that can look at a production incident is useful. An agent that can also change production is a second incident waiting for a bad day. Most teams resolve that tension by choosing one extreme: hand the agent the same credentials an on-call engineer uses, or keep it out of the incident entirely and go back to <code>kubectl</code> and grep.</p>
<p>The direct answer to the middle path is this: &ldquo;read-only&rdquo; is not one control, it is four, and they do not fail together. The agent&rsquo;s tool selection is advisory. The other three — the credential or API scope the call travels over, the database transaction mode, and the runtime guard on evaluated expressions — are enforced somewhere outside the agent&rsquo;s goodwill. A session is only as safe as the outermost enforced layer, and it is only auditable if the enforcement decision is recorded per call.</p>
<h2 id="four-layers-and-only-three-of-them-are-enforced-by-something-other-than-the-agent">Four layers, and only three of them are enforced by something other than the agent</h2>
<p>When a vendor, a framework, or your own tool wrapper says a debugging capability is read-only, the guarantee is coming from one of these layers. They are not equivalent.</p>
<table>
	<thead>
			<tr>
					<th>Layer</th>
					<th>Enforced by</th>
					<th>What it stops</th>
					<th>Typical failure</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>Agent tool selection</td>
					<td>The agent&rsquo;s own policy loop</td>
					<td>A write tool that was not offered</td>
					<td>The agent holds a second credential, or the wrapper exposes an unlisted tool</td>
			</tr>
			<tr>
					<td>Interface scope (API, MCP server, SQL user grants)</td>
					<td>The remote server or the database grant</td>
					<td>Operations the credential cannot perform</td>
					<td>The credential is broader than the task and reused across sessions</td>
			</tr>
			<tr>
					<td>Database transaction mode</td>
					<td>The database engine</td>
					<td>Statement classes the engine refuses inside a read-only transaction</td>
					<td>The engine&rsquo;s own documented gaps, and anything outside SQL</td>
			</tr>
			<tr>
					<td>Runtime expression guard</td>
					<td>The language runtime</td>
					<td>Evaluated expressions with detectable side effects</td>
					<td>The guard is experimental, conservative, or absent for the runtime in use</td>
			</tr>
	</tbody>
</table>
<p>The first row is a promise. The second, third, and fourth rows are refusals that happen whether or not the agent agrees. If your only read-only control is the first row, you are trusting a language model to keep a promise under adversarial input, which is exactly the condition in which it will not. If your control is the third row, you get a hard stop at the engine — but only for the statement classes the engine documents, which is where the interesting gaps live.</p>
<h2 id="drawing-the-capability-envelope">Drawing the capability envelope</h2>
<p>An envelope is a written answer to one question: what may this agent do to this system, in this environment, for the length of this session? Three categories make it usable, and the third one is the one teams forget.</p>
<ul>
<li><strong>Observe.</strong> Read the schema, read logs, read metrics, <code>EXPLAIN</code> a query without <code>ANALYZE</code>, read the deployed commit and config. These are the operations an incident actually needs, and every one of them has a read-only form.</li>
<li><strong>Derive.</strong> Aggregate, correlate by trace ID, diff two deploys, compute a rate. Derivation is where a debugging agent earns its place, because it turns reads into an answer. It is also where the line is easiest to blur, since &ldquo;derive&rdquo; invites <code>EXPLAIN ANALYZE</code>, which executes the plan and is therefore not a read.</li>
<li><strong>Refused by design.</strong> Any DDL or DML, any expression that can invoke a getter or a function, any process execution, any credential other than the session&rsquo;s own. The refusal must be visible to the agent — a silent empty result teaches the model that the tool is broken and invites a retry through another path.</li>
</ul>
<p>The scope of the envelope is not just the operation list. It is the tuple of environment, database or service, and version, plus the limits: statement timeout, row cap, session duration, and capture budget. A read-only query without a row cap is a denial-of-service primitive, and an unbounded capture buffer inside a production process is a memory incident.</p>
<h2 id="where-the-guarantee-leaks">Where the guarantee leaks</h2>
<p><strong>PostgreSQL&rsquo;s read-only transaction is a high-level notion, and the documentation says so.</strong> <code>SET TRANSACTION READ ONLY</code> disallows <code>INSERT</code>, <code>UPDATE</code>, <code>DELETE</code>, <code>MERGE</code>, and <code>COPY FROM</code> when the target is not a temporary table; all <code>CREATE</code>, <code>ALTER</code>, and <code>DROP</code> commands; <code>COMMENT</code>, <code>GRANT</code>, <code>REVOKE</code>, <code>TRUNCATE</code>; and <code>EXPLAIN ANALYZE</code> or <code>EXECUTE</code> of any of those. The same page says plainly that this &ldquo;is a high-level notion of read-only that does not prevent all writes to disk&rdquo; — and writes into temporary tables remain permitted. If a debugging agent can create and fill a temp table, it has a write path inside a nominally read-only transaction. See the <a href="https://www.postgresql.org/docs/current/sql-set-transaction.html">PostgreSQL SET TRANSACTION documentation</a>.</p>
<p><strong>A side-effect guard refuses what it cannot rule out, not what is impure.</strong> In the Chrome DevTools Protocol, <code>Runtime.evaluate</code> takes <code>throwOnSideEffect</code>, documented as &ldquo;whether to throw an exception if side effect cannot be ruled out during evaluation&rdquo;, and the parameter is marked experimental. That wording is conservative in the right direction, but it is a refusal test, not a purity proof: an expression that does not trip the flag is not thereby shown to be side-effect free, and a specific V8 build or a vendor SDK may pass the flag through differently. The <a href="https://chromedevtools.github.io/devtools-protocol/tot/Runtime/">CDP Runtime domain</a> lists the parameter and its experimental marker.</p>
<p><strong>The layer a probe runs in decides which guarantee you get.</strong> A Python in-process probe uses either <code>sys.settrace</code> or the newer <code>sys.monitoring</code> namespace, added in 3.12, which lets a tool register callbacks for execution events and assigns each tool an integer identifier so concurrent tools do not interfere. That is an observation surface, not a read-only guarantee: enforcement there is whatever the tool&rsquo;s own policy layer implements on top. The <a href="https://docs.python.org/3/library/sys.monitoring.html">Python <code>sys.monitoring</code> documentation</a> describes the callbacks and tool IDs and nothing about side effects.</p>
<p><strong>The second credential is the leak nobody instruments.</strong> An agent denied a write tool will happily use a shell tool, an HTTP client, or an MCP server that was never in the envelope, if one is reachable. Envelope enforcement that lives only inside the agent&rsquo;s tool list does not survive a second tool server being mounted, which is why the credential scope and the network egress, not the tool list, are the controls that matter.</p>
<h2 id="what-an-auditable-session-record-must-contain">What an auditable session record must contain</h2>
<p>A transcript is not an audit record. A transcript shows what the agent said; an audit record shows what the system decided, and it is the second one that a security reviewer will ask for. Thirteen fields cover the questions that come up after an incident:</p>
<table>
	<thead>
			<tr>
					<th>Field</th>
					<th>Question it answers</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>Session and run ID</td>
					<td>Which investigation was this, and can it be replayed?</td>
			</tr>
			<tr>
					<td>Sequence number</td>
					<td>What order did the calls happen in, including refusals?</td>
			</tr>
			<tr>
					<td>UTC timestamp</td>
					<td>When, against which deploy and which incident window?</td>
			</tr>
			<tr>
					<td>Acting agent identity</td>
					<td>Which agent, under which task, with which instructions?</td>
			</tr>
			<tr>
					<td>Model identifier and version</td>
					<td>Which model chose these calls?</td>
			</tr>
			<tr>
					<td>Envelope policy hash</td>
					<td>Which exact policy bytes were in force?</td>
			</tr>
			<tr>
					<td>Tool name and argument hash</td>
					<td>What was attempted, without storing the arguments themselves?</td>
			</tr>
			<tr>
					<td>Decision and rule ID</td>
					<td>Allowed or denied, and which rule decided?</td>
			</tr>
			<tr>
					<td>Target scope</td>
					<td>Which environment, database, service, and version?</td>
			</tr>
			<tr>
					<td>Result digest and byte count</td>
					<td>What came back, and can it be proved unchanged?</td>
			</tr>
			<tr>
					<td>Redaction events</td>
					<td>What was removed before the record was written?</td>
			</tr>
			<tr>
					<td>Retention and immutability</td>
					<td>How long does this survive, and who can delete it?</td>
			</tr>
			<tr>
					<td>Side-effect assertion</td>
					<td>Did the refusal happen before or after any execution?</td>
			</tr>
	</tbody>
</table>
<p>The last two are the ones that turn a log into evidence. Deletable records are a data-hygiene feature, not an audit trail: if the captured payloads can be purged on request, the immutable part must live somewhere else, and the record has to say which part it is.</p>
<h2 id="testing-your-own-envelope-instead-of-trusting-its-description">Testing your own envelope instead of trusting its description</h2>
<p>The check is small enough to run on a laptop, and the point is the negative assertions: it must prove that the write is refused, not that the read works. I wrote a fixture that does this and ran it locally. It has a seeded SQLite database with a read-only view, a deny-by-default envelope policy, a scripted client that attempts the calls a debugging agent would attempt, and a per-call audit record.</p>
<p>It is a local fixture, not a vendor measurement, and the client is scripted on purpose: no language model was invoked, so the run measures the enforcement layers and the record they produce, and says nothing about which tools a model would choose or whether it retries after a refusal.</p>
<p>The database layer refused six of seven statements. Five of them — the INSERT, the UPDATE, the DELETE, a <code>CREATE TABLE</code>, and a <code>CREATE TEMP TABLE</code> — raised <code>OperationalError: attempt to write a readonly database</code>, and the sixth, a follow-up insert into the temp table, raised <code>no such table: scratch</code> because the create had already been refused. The <code>SELECT</code> through the view returned rows. The tool layer saw nine calls: four allowed, five refused, and four distinct rules fired (<code>TOOL_DENIED</code>, <code>SQL_NOT_SELECT</code>, <code>SQL_MULTI_STATEMENT</code>, <code>EXPR_CALL</code>). Every refusal came back to the caller as a message naming the rule that fired, which is what makes the refusal useful to the agent rather than merely safe. The orders table fingerprint was identical before and after the session, and all six rows remained.</p>
<p>The audit record is where the run was least satisfying, and that is the useful finding. The fixture declares thirteen fields — <code>session_id</code>, <code>seq</code>, <code>ts_utc</code>, <code>actor_agent_id</code>, <code>actor_model_id</code>, <code>policy_sha256</code>, <code>tool</code>, <code>args_sha256</code>, <code>decision</code>, <code>rule_id</code>, <code>scope</code>, <code>result_sha256</code>, <code>result_bytes</code> — and that is not the thirteen-field set recommended in the table above. It carries no run identifier apart from the session, and it has no redaction-event, retention-or-immutability, or side-effect-assertion field: those three, plus a run ID, are the recommended fields the fixture does not implement, which is why its record cannot answer the last three questions in that table. Nine of the thirteen fields it does declare were non-null on every record. The four that were null somewhere were <code>actor_model_id</code>, <code>rule_id</code>, <code>result_sha256</code>, and <code>result_bytes</code>. The first is honest — no model ran. The other three are design bugs that a real deployment would inherit from a naive implementation: <code>rule_id</code> is null on the allowed path, so the record cannot say which rule permitted a call; and a denied call carries no result digest, so nothing in the record distinguishes &ldquo;refused before execution&rdquo; from &ldquo;refused after partial execution&rdquo;. A record that omits the allow-path rule makes the permissive decisions unauditable.</p>
<p>The fixture ran against SQLite 3.45.1 under Python 3.12.3, and its temp-table behaviour differed from PostgreSQL&rsquo;s: <code>PRAGMA query_only</code> refused the temp-table create outright, while PostgreSQL documents temp-table writes as permitted inside a read-only transaction. That difference is the reason to state a guarantee per engine and per layer instead of writing &ldquo;read-only&rdquo; on the architecture diagram. The files are in the repository under <code>research/evidence/hyperprobe-readonly-debugging-agents-2026/</code> and the raw links resolve once the commit is published: <a href="https://raw.githubusercontent.com/baeseokjae/baeseokjae.github.io/main/research/evidence/hyperprobe-readonly-debugging-agents-2026/fixture_check.py">fixture_check.py</a>, the <a href="https://raw.githubusercontent.com/baeseokjae/baeseokjae.github.io/main/research/evidence/hyperprobe-readonly-debugging-agents-2026/envelope.json">envelope policy</a>, the <a href="https://raw.githubusercontent.com/baeseokjae/baeseokjae.github.io/main/research/evidence/hyperprobe-readonly-debugging-agents-2026/observed.json">observed run record</a>, and the <a href="https://raw.githubusercontent.com/baeseokjae/baeseokjae.github.io/main/research/evidence/hyperprobe-readonly-debugging-agents-2026/README.md">README with limits</a>. They contain only synthetic rows and an invented log fixture.</p>
<h2 id="hyperprobe-as-one-implementation-with-the-vendors-claims-attributed">HyperProbe as one implementation, with the vendor&rsquo;s claims attributed</h2>
<p>HyperProbe is a YC S26 company that sells read-only probes for production services; its own documentation describes two workflows, placing and inspecting probes manually in VS Code, or letting an MCP-connected coding agent investigate an incident (<a href="https://docs.hyperprobe.co/how-it-works">How It Works</a>). Its founders described the enforcement model in the <a href="https://news.ycombinator.com/item?id=49185389">Launch HN thread</a>, and their answer is a compact illustration of the layer problem. By default probes attach at a file, class, and line with metadata, which they describe as read-only and safe by default. Once a probe carries a condition, the guarantee becomes runtime-specific: on Node they rely on <code>throwOnSideEffect: true</code>; on Python and Java they do not permit method invocations in conditions at all and accept only a subset of comparison operators, with no assignment.</p>
<p>That restriction is the practical version of the getter problem. In the founder&rsquo;s own example, <code>total &gt; 50</code> is permitted, <code>order.total &gt; 50</code> is refused because a property access may run a getter that caches, logs, or writes, and <code>order.get_total() &gt; 50</code> is refused under the ban on method invocations. Without a purity proof, denying property access as well as calls is the only way to keep a conditional probe read-only. The permitted operator subset is not enumerated in that thread, so treat it as &ldquo;smaller than you assume&rdquo; rather than as a specification.</p>
<p>On auditing, the founder&rsquo;s answer at launch was that an audit trail was on the roadmap and that probe-captured data could currently be deleted — while also raising the tension between immutable records and removing sensitive captured data. That is a point-in-time statement from the vendor, not a claim about the current build, and it is exactly the field-level gap the table above exists to catch: capture deletion and audit immutability have to be separate mechanisms, or the record is not evidence.</p>
<h2 id="checklist-before-you-hand-an-agent-production-read-access">Checklist before you hand an agent production read access</h2>
<ol>
<li>One credential per session, scoped to the database, service, and version in the envelope, expiring with the session.</li>
<li><code>READ ONLY</code> (or the engine&rsquo;s equivalent) set as the default transaction mode for the agent&rsquo;s connection, not passed as an option the agent can omit.</li>
<li>Statement timeout and row cap enforced at the connection, not in the prompt.</li>
<li>Deny-by-default tool allowlist, with the tempting write tool present in the list and explicitly denied, so the refusal is a tested path rather than a missing feature.</li>
<li>Expression guard that refuses calls and assignments, tested against a getter and against an assignment.</li>
<li><code>EXPLAIN</code> without <code>ANALYZE</code> in the observe set; <code>ANALYZE</code> classified as execution.</li>
<li>Capture redaction applied before the record is written, with the redaction events themselves recorded.</li>
<li>The thirteen audit fields present per call, including the allow-path rule and a pre-execution refusal marker.</li>
<li>A session cap on wall-clock time, call count, and captured bytes.</li>
<li>One off-switch that revokes the credential rather than asking the agent to stop.</li>
</ol>
<p>Run items four and five against the real enforcement point and keep the output. A deny that was never exercised is a claim, and the difference between a claim and a control is one recorded refusal.</p>
<h2 id="faq">FAQ</h2>
<p><strong>Is read-only the same as safe?</strong> No. Read-only bounds the operations, not the cost: an unbounded scan, a huge capture buffer, or an expensive regex over logs can degrade the system without writing anything. The envelope needs resource limits for the same reason it needs an operation list.</p>
<p><strong>Does <code>READ ONLY</code> prevent all writes?</strong> Not in PostgreSQL&rsquo;s own words. The documentation calls it a high-level notion that does not prevent all writes to disk and permits writes into temporary tables, so treat it as the statement-class control it is and put the rest elsewhere.</p>
<p><strong>Is <code>throwOnSideEffect</code> a proof of purity?</strong> No. It throws when a side effect cannot be ruled out, which is a conservative refusal test rather than a proof, and the parameter is experimental in the protocol listing.</p>
<p><strong>Can an audit trail coexist with deleting sensitive captures?</strong> Yes, if they are different records. Keep the decision record and its digests immutable, and treat the captured payload as a separate, expiring artifact whose deletion is itself an audited event.</p>
<p><strong>Do I need a vendor to get this?</strong> No. Two of the four layers are configurations you already own: a scoped credential and a read-only transaction mode. The work that a vendor adds is the runtime instrumentation and the MCP surface, and that is the part worth paying for only when in-process capture is what you actually need.</p>
<p>If the agent is only reading logs, metrics, and schemas over an API, the envelope is a policy file and a connection string. If you are further along in rollout, the wider controls sit next to this one: <a href="https://baeseokjae.github.io/posts/ai-agent-security-tools-2026/">agent security tooling</a> covers the detection side, the <a href="https://baeseokjae.github.io/posts/ai-agent-production-go-live-checklist-2026/">production go-live checklist</a> covers what has to be true before an agent touches production at all, and the <a href="https://baeseokjae.github.io/posts/agentjacking-mitigation-guide-2026/">agentjacking mitigation guide</a> covers what happens when the agent can be steered by the content it reads.</p>
]]></content:encoded></item></channel></rss>