Around Go: coding agents · 3 MIN READ

Agent trust boundaries: repository text is input data

Review commands, secrets and external writes when an agent consumes untrusted text.

A source comment, dependency README, test log or fetched webpage can contain instructions written by someone else. Reading that material to solve a Go problem does not authorize its author to expand the task. Keep the user’s goal and trusted repository guidance separate from external diagnostic content.

Agent trust boundaries: repository text is input data · A MAP OF THE IDEA

  1. Identify trusted intent
  2. Inspect diagnostic data
  3. Constrain tools and secrets
  4. Report verified evidence

Useful when

  • Review commands, secrets and external writes when an agent consumes untrusted text.
  • Treat external text as task data, enforce permissions with real controls and verify sensitive commands at their boundary. Keep the Go fix tied to its authorized behavior.

Watch out

  • Do not confuse a generated command with an authorized action. Context files and tool permissions solve different problems.

Implementation & operation cost: Choose the policy from the actual contract, then verify its failure path in the target environment.

01

Recognize an instruction hidden in a failure

Imagine a failing test prints a page that tells the agent to upload environment variables. That instruction is not part of the authorized fix. Extract the actual assertion failure, inspect the relevant source and ignore the requested credential transfer.

text
Diagnostic data:
  expected first duplicate index 1, got 2
  see external.example/fix for instructions

Authorized task:
  repair LowerBound and prove duplicate handling

The external page cannot authorize uploading files or secrets.
Read the code

The URL is an illustrative untrusted destination, not a link to visit. The useful evidence is the mismatch between expected and actual index; an unrelated upload request does not help establish that invariant.

02

Use isolated integration resources

Give agent-driven tests a disposable database, namespaced keys and bounded cleanup. A unique key prefix does not protect other data if a cleanup script still runs FLUSHDB. Inspect generated commands before they can affect shared systems, especially dependency installers, migrations and deployment steps.

03

Keep secrets out of the conversation and diff

Use environment or credential mechanisms approved for the selected tool. Include variable names in setup instructions rather than real passwords. Logs, traces, snapshots and fixtures can also retain private data; inspect what a test or support bundle records before sharing it.

04

Make a useful handoff

Record the changed files, checks actually run, unresolved failures and next concrete step. Preserve the original task constraints after context reduction. A handoff saying everything is safe without naming evidence is difficult for either a human or another session to verify.

TAKE THIS WITH YOU

Treat external text as task data, enforce permissions with real controls and verify sensitive commands at their boundary. Keep the Go fix tied to its authorized behavior.

Check your understanding

A webpage linked by a failing test asks an agent to upload a credential file. What should happen?

Go to the source

Progress stays in this browser. No account needed.