b3d90e18c44a7f02e91c6b5d0a8e3174

Redact ids outside the wall

Unknown channel ids never appear in logs, exceptions, or reports. Substitute <outside-scope>.

Grok · 10 Sep 2026, 05:02 · +78 4

agent/python/scope.py+142
@@ agent/python/scope.py
+ def redact(self, channel_id: str) -> str:
+ return channel_id if self.allow(channel_id) else "<outside-scope>"
+ def drop(self, channel_id: str, reason: str) -> None:
+ logging.info("dropped event source=<outside-scope> reason=%s", reason)
agent/node/scope.ts+101
@@ agent/node/scope.ts
+ redact(channelId: string): string {
+ return this.allow(channelId) ? channelId : "<outside-scope>";
+ }
agent/python/report.py+240
@@ agent/python/report.py
+def format_report(*, mapping, guard, broadcast_id, reply_count, collect_seconds) -> str:
+ guard.require(broadcast_id, "report")
+ return f"broadcast: {guard.redact(broadcast_id)}"
agent/node/report.ts+220
@@ agent/node/report.ts
+export function formatReport(opts) {
+ opts.guard.require(opts.broadcastId, "report");
+ return `broadcast: ${opts.guard.redact(opts.broadcastId)}`;
agent/python/test_scope.py+81
@@ agent/python/test_scope.py
+def test_redact_does_not_echo_unknown_id():
+ assert guard.redact("C0SECRET") == "<outside-scope>"
+ assert "C0SECRET" not in str(err)