Plan · ox CLI · new command · 2026-10-12
Let AI coworkers report ox bugs to SageOx without leaking secrets
Draft for Galex. Built from a code survey and an adversarial design review. Each claim cites a file and line under Evidence at the end. Light modeDark mode
Decision
Add one command, ox feedback. An AI coworker uses it to send SageOx a bug report or an idea about ox. ox checks the report on the laptop before anything leaves. It refuses reports that contain credentials or large pastes of code. It replaces details that identify the person, such as emails and home folders. Then it shows the exact report, and sends it only after the person says yes.
Your call: approve the plan and answer four questions. Each has a default, so "yes to all" works. Details are in the next section.
- Keep the name
ox feedback? Default yes. Ryan rules on it before any code is written. - Ship with consent relayed by the AI coworker? Default yes.
- Promise only that a report "goes to SageOx, tied to your SageOx account"? Default yes.
- Require sign-in to send? Default yes.
What you are approving
ox feedback --file -. The report arrives on stdin, never as command arguments.- Local checks run before anything is sent. They refuse credentials and large code pastes. They replace identifying details.
- Two calls when an AI coworker sends a report. The first returns a preview and sends nothing. The second sends that exact preview after the person agrees. A person at a terminal answers y/N in one call.
- One line in the session-start context (prime), one line in
ox --help, and a hint when the person says "send this to SageOx". - A separate small fix that ships first. Today, mistyped ox commands send what was typed to SageOx without redaction.
Biggest risk
ox cannot prove a person saw the report. When an AI coworker relays the preview, ox has to trust it. A prompt-injected AI coworker could skip the person and confirm on its own.
The hard limits still hold in that case. A report cannot carry a detected credential, more than 4 KiB, or more than 30 lines of code. Each report is marked as relayed by an AI coworker, so SageOx never treats it as approved by a person. A person-verified approval step is a follow-up.
Cost
Two PRs. The fix is about 150 lines of Go. The command is about 1,000 lines of Go and 1,700 lines of tests. That is roughly 60% of ox bulletin post.
Outside this repo
SageOx needs a new endpoint to receive reports. That work is tracked separately. The command PR merges only after the endpoint is live.
Team context
No earlier work or decisions on this topic. The closest pattern is your ox bulletin post plan from 2026-09-22. ox flagged Faridun's edits to the same prime file today. That change is already on main (#1317), so no conflict is expected.
One report, start to finish
Hover or tab to a box to see what happens there. Everything left of the dashed line happens on the person's laptop.
Gold boxes are new ox code. The green box is the one step only a person can take. The dashed box is the SageOx endpoint, built outside this repo. The AI coworker writes the report. It describes what went wrong in words. It passes the text on stdin with ox feedback --file -. Arguments are never accepted, because ox's typo reporting can send arguments to SageOx. ox checks the report on the laptop. Credentials, invisible characters, more than 30 lines of code, or more than 4 KiB stop it cold. Emails, home folders, the person's name, and the repo's remote URL are replaced with placeholders. The preview is the exact outgoing report. It lists every replacement and every extra detail sent with it. It carries an id tied to this exact report and a ready-made next_command. Nothing has left the laptop. The person decides. The AI coworker shows the preview word for word and asks. At a terminal, a person can answer y directly. ox cannot see this step when an AI coworker relays it. ox checks again, then sends. The second call carries the id from the preview. ox re-runs every check. If the text changed since the preview, it returns a fresh preview instead of sending. SageOx stores the report and returns a receipt id. The request is signed in as the person, so the report needs no name or email inside it. The endpoint is new work outside this repo. Nothing is sent when the person says no. The AI coworker can edit the report and preview again. If the report changes after the person approved it, ox returns a fresh preview instead of sending. A refused report never leaves. The reply names the line and the kind of problem, never the matched text. The guidance tells the AI coworker how to rewrite, and to stop after two refusals. new ox codeperson's steprefusedoutside this repo
Four questions
Four questions for you
Each question sets a precedent, so I did not decide it alone. Each has a default. Reply "yes to all", or name the number you want changed.
1
Keep the name ox feedback?
Default Yes. Its one-line help reads "Send a bug report or idea about ox to SageOx". Its help, prime row and hint all point plan review comments to ox plan feedback.
"Feedback" already means plan review comments. A draft decision record (ADR-025) reserves that word and is waiting on Ryan. Renaming after the build touches prime, help, generated docs, tests and the acceptance file. So Ryan should rule before code is written.
2
Ship consent that the AI coworker relays?
Default Yes. Each report is marked as relayed by an AI coworker. The hard limits apply no matter who confirms. A person-verified approval step comes later.
Free text already reaches SageOx through commands like ox query and ox bulletin post. Those serve the person's own team. This is the first channel written for SageOx staff to read. A prompt-injected AI coworker can still confirm on its own. The limits cap what one report can carry. They cannot stop the send.
3
What may ox's wording promise about how SageOx handles reports?
Default Only this: the report "goes to SageOx, tied to your SageOx account". Plus a warning: "Don't include code or data you can't share with SageOx." No licence, retention, or confidentiality claims yet.
The public issue tracker's terms grant SageOx a full copyright licence to any code in a report (CONTRIBUTING.md). An AI coworker cannot accept terms for the person. Public copy must not state a policy SageOx has not approved.
4
Require sign-in to send?
Default Yes. Shared team service tokens are refused too. A signed-out person at a terminal sees the public GitHub issues link, with a warning that anyone can read it. JSON output never includes the link.
This excludes people whose problem is signing in. The alternative is an anonymous endpoint, which needs abuse controls on the server. AI coworkers never see the link. They hold the draft before ox replaced anything, and could post it with the GitHub CLI.
What can leave the machine
An AI coworker writes the report, so it can carry anything the AI coworker has seen. That might be a token from a log, the person's email, or a chunk of their code. ox sorts what it can detect into two groups. Some things refuse the whole report. Others are replaced, and the report goes on. A few things no automatic check can catch.
Refuse · nothing is sent
- Credentials. The same rules session recording uses, about 240 of them. Plus three rules for feedback only: private keys of every kind, long random-looking tokens, and passwords written in prose.
- Invisible or text-direction characters. These can hide a split token. They also make the preview differ from what is sent.
- More than 30 lines of code, counted across the whole report.
- More than 4 KiB.
Replace · sent, counted in the preview
- The person's home folder →
~. Other home folders →[home]. - Emails →
[email]. - The person's name, username and hostname →
[user]/[host]. Only whole words of four or more letters, and never words like "ox" or "dev". - This repo's remote URL →
[repo-remote]. - Matches of the team's own redaction rules →
[REDACTED_TEAM_RULE].
Cannot detect · the person's review only
- Other people's names.
- Customer code that was paraphrased rather than pasted.
- Business details, such as a client's name in a sentence.
The copy never calls a report "PII-free". The guidance says to describe the problem in words and never paste the person's code.
Why refuse credentials instead of replacing them? The existing private-key rule matches only the key's first line. Replacing that line would still send the key body. Refusing makes the AI coworker rewrite the whole passage.
Try it
Pick a report. The left side is what the AI coworker passes in. The right side is what ox replies. These are illustrations; token values are masked so this page stays clean.
A clean bug report A key in a log line Email and home folder A 62-line code paste A token split by a hidden character AI coworker passes on stdin
ox status hangs after upgrading to 0.17
In a repo with a Ledger, `ox status` never returns.
`ox doctor` passes every check.
It started right after `ox upgrade` this morning.
ox replies · exit 0
{
"status": "preview",
"sent": false,
"preview": {
"title": "ox status hangs after upgrading to 0.17",
"body": "In a repo with a Ledger, …",
"replaced": {},
"consent": "relayed",
"also_sent": ["ox version, OS and CPU type",
"AI coworker type and version", "repo id", "trace id"]
},
"preview_id": "fbp_q8Zt2mK4vN1xR7cW_3f9a07c1…",
"next_command": "ox feedback --file - --json --confirm fbp_q8Zt…",
"guidance": "Nothing was sent yet. Show the user the report
word for word, not a summary, and ask whether to
send it to SageOx. …"
}
preview Nothing matched. The AI coworker now shows this to the person.
AI coworker passes on stdin
ox session upload fails with 403
Log line from the failing run:
aws_access_key_id=AKIA••••••••••••••••
The upload retries three times, then gives up.
ox replies · exit 1
{
"status": "blocked",
"sent": false,
"error": "blocked",
"findings": [
{ "detector": "aws_access_key", "line": 3 }
],
"guidance": "Nothing was sent. The lines listed in findings
look like a credential. Delete the value entirely;
never split, space out, encode, or partly quote it.
Name a token by its prefix only, like ghp_. Then
preview again. If it is blocked twice, stop and tell
the user. Do not post this report anywhere else on
the user's behalf."
}
blocked The reply names the line and the rule. It never repeats the key, so the key does not land in the session recording either.
AI coworker passes on stdin
Daemon panics right after login
Signed in as jane.doe@acme.com.
The log at /Users/jane/Library/Logs/sageox/daemon.log
shows a nil-pointer panic in sync.
Remote is git@github.com:acme/payments.git
ox replies · exit 0
{
"status": "preview",
"sent": false,
"preview": {
"title": "Daemon panics right after login",
"body": "Signed in as [email].\nThe log at ~/Library/
Logs/sageox/daemon.log shows a nil-pointer
panic in sync.\nRemote is [repo-remote]",
"replaced": { "email": 1, "home": 1, "repo_remote": 1 },
"team_rules_applied": true,
"consent": "relayed"
},
"preview_id": "fbp_…",
"next_command": "ox feedback --file - --json --confirm fbp_…"
}
replaced Three details were swapped for placeholders. The preview shows the counts, so the person sees what changed.
AI coworker passes on stdin
Wrong rounding in the billing export
ox summarized the session wrong. Here is the file:
```go
package rates
… 60 more lines of the person's code …
ox replies · exit 1
{ "status": "too_much_code", "sent": false, "error": "too_much_code", "findings": [ { "detector": "code_lines", "count": 62, "limit": 30 } ], "guidance": "Nothing was sent. The report has more than 30 lines of code. Describe what went wrong in words. Keep the ox command you ran and its error message. Never include the user's source code. …" }
too_much_code Fenced and indented code lines both count. Stack traces and short log excerpts still fit under the limit.
AI coworker passes on stdin
ox login loops forever I tried the token ghp_••••⟨U+200B⟩•••••••• by hand. It still loops.
ox replies · exit 1
{ "status": "invisible_characters", "sent": false, "findings": [ { "detector": "invisible_character", "line": 2 } ], "guidance": "Nothing was sent. The lines listed in findings contain invisible or text-direction characters. Remove them, then preview again. …" }
invisible_characters A hidden character can split a token so no rule matches it. Refusing these also keeps what the person reads identical to what is sent.
What the code guarantees
- Nothing leaves without passing every check.
- Detected credentials, hidden characters, oversize reports and large code pastes never leave.
- The bytes sent equal the bytes previewed.
- `--yes`, `OX_YES` and `--no-input` never count as a person's yes.
- ox started by another ox process never sends, so hooks and background workers cannot.
What it does not guarantee
- That a person saw the preview, when an AI coworker relays it.
- Protection from a prompt-injected AI coworker. The limits shrink what one report can carry. They do not stop the send.
- That undetectable content stays out: other people's names, paraphrased code, business detail.
## Consent
## Consent: two calls per report
ox cannot see the person. When an AI coworker calls it, ox can only hand back a preview and ask the AI coworker to show it. So every report takes two calls. The first call returns the preview. The second call, with the preview's id, sends it.
### Who is calling?
Pick a caller to see what the first call does.
An AI coworker (any host) A person at a terminal A script with --yes or OX_YES ox started by another ox
**Preview, then a second call.** The first call returns the preview with `sent: false`. The guidance says to show it word for word and ask. If no one can answer, the AI coworker stops there. The second call runs `next_command`. The report is marked `consent: relayed`.
**Preview and a question in one call.** ox prints the preview and asks "Send this to SageOx? [y/N]". The default is No. This path needs a real terminal, no AI coworker detected, no `--json`, and a report read from a file. The report is marked `consent: terminal`.
**Nothing is sent.** `--yes` and `OX_YES` are ignored on purpose. A piped "y" is ignored too. The only way to send without a terminal is `--confirm` with an id that matches this exact report.
**Refused.** When another ox process started this one, it refuses with `nested_ox`. Hooks and background workers can never send a report.
What the preview id does
It ties the send to the exact text that was previewed. The id is a random part plus a fingerprint of the report. If the report changes between calls, ox returns a fresh preview instead of sending. ox stores nothing between the two calls.
What it does not do
It does not prove a person looked. The AI coworker receives the id and could pass it straight back. Anyone can also compute a matching id without calling the preview, because the fingerprint uses no secret. A follow-up can close this gap. The person would type an approval phrase containing the id, and ox's prompt hook would see it.
## How AI coworkers find it
Every word in the session-start context (prime) is paid in every session. So prime gets one line. The rest lives where an AI coworker looks at the moment it acts. Hover a tier to see its exact words.
1Prime command tableone row, read at every session start~37 tokens 2Prompt hintonly when the person's message matches0 unless matched 3ox --helpDiagnostics group and a footer line0 until run 4Bare ox feedbackthe step-by-step pageread once 5ox feedback --helpevery rule in fullon demand 6Each reply's guidancewhat to do next, for that outcomeper reply Why layers
An AI coworker that never reports a bug pays only tier 1. One that does reads tiers 4 and 6 at the moment it acts. Nothing goes in a skill file. Codex and other hosts do not load Claude skills, so the rules live in ox's own output.
Prime row · added right after ox doctor
| report an ox bug or idea to SageOx when the user asks, | or offer to if ox still fails after ox doctor | (not plan-review comments) → ox feedback
The trigger is narrow on purpose. The AI coworker reports when asked, or offers after `ox doctor` fails to fix something. Its own typos do not count; ox already learns from those.
Prompt hint · one line, injected on a match
To send this to SageOx, run 'ox feedback' first; it explains the steps. Plan review comments use 'ox plan feedback'.
It fires on phrases like "feedback to sageox", "report this to sageox" and "ox bug". It reuses the hook that already offers plan rendering. "ox plan feedback" does not trigger it.
ox --help
Diagnostics: doctor Run diagnostics on ox installation and configuration feedback Send a bug report or idea about ox to SageOx … Report an ox bug or idea to SageOx: ox feedback
This also closes a known gap. ox's CLI guidelines (ADR-034) ask that help name where to report a bug, and today it does not.
Bare ox feedback · never reads stdin
ox feedback: send a bug report or idea about ox to SageOx. For plan review comments, use 'ox plan feedback' instead.
When to use it The user asks you to report something to SageOx, or ox still fails after 'ox doctor' and the user agrees. Not for your own mistyped commands.
How an AI coworker sends a report
- Pass the report on stdin with --file -. Line 1 is the title. ox feedback --file - --json <<'EOF' ox status hangs after upgrading to 0.17 It never returns in a repo with a Ledger. EOF
- ox replies with a preview and a next_command.
- Show the user the preview word for word and ask.
- Only after a clear yes, run next_command.
Before anything leaves this machine ox refuses credentials, hidden characters, more than 30 lines of code, or more than 4 KiB. It replaces emails, home paths, your name, and this repo's remote URL. Describe the problem; never paste the user's code.
ox feedback --help covers
- Direction: this goes to SageOx. It is not plan review.
- When to send, and when not to.
- The two calls, and that `--yes` never sends.
- What is refused and what is replaced.
- The extra details sent with every request, and that the report is tied to the person's SageOx account.
- That a recorded session keeps this exchange in the team's Ledger, like any other command.
- Two examples: a file and a heredoc.
Guidance per outcome · examples
sent Sent to SageOx. Tell the user it was sent and give them the receipt_id. Do not send it again. blocked Nothing was sent. … If it is blocked twice, stop and tell the user. not_logged_in Nothing was sent. Sending needs a signed-in person. Ask the user to run 'ox login' in their own terminal, then try again.
Every reply where nothing was sent ends with "Do not post this report anywhere else on the user's behalf." A test checks that no guidance mentions github.com or the `gh` command.
### Why prime alone is not enough
On Claude Code, the session-start hook output is capped at 10,000 characters. In repos with rich team context, a trimmer cuts sections from the bottom of a 28-section keep list. The command table is 19th, so it is the 10th section cut. The AI coworker then sees only a pointer to the full file. So the prompt hint and the command's own output carry discovery there. Prime still covers direct `ox agent prime` runs and other hosts.
## A leak to fix first
When someone mistypes an ox command, ox tells SageOx what was typed. That helps ox learn common typos and suggest fixes. Today it sends the raw text, up to 500 characters, with no redaction. That already affects commands that take free text, such as `ox murmur`. A new feedback command would invite more of it.
Today After the fix An AI coworker mistypes the command
$ ox agent Oxa7b3 feedback "billing bug in /Users/jane/acme/rates.go …" Error: unknown command: feedback
Typo report sent to SageOx
{ "kind": "unknown-command", "input": "agent Oxa7b3 feedback billing bug in /Users/jane/acme/rates.go …", "error_msg": "unknown command: feedback\nAvailable: doctor, heartbeat, hook, …" }
today The whole sentence leaves, including the path and username.
The same mistake
$ ox agent Oxa7b3 feedback "billing bug in /Users/jane/acme/rates.go …" feedback is a top-level command, not part of 'ox agent'. Run 'ox feedback' alone for the steps.
Typo report sent to SageOx
none sent
after No typo report leaves for any mistyped `ox feedback` command. For every other command, only command words and flag names leave, and each value becomes `<arg>`.
- ox's privacy record (ADR-008) lists command arguments under "What we never collect". The typo reporter does collect them. The typo-report spec says redaction is "already implemented". The code never sets a redactor, so text passes through unchanged.
- The fix keeps command words and flag names. It replaces every value with `<arg>`. A short lowercase unknown word survives, so ox still learns typos like `feedbak`.
- The daemon applies the same rewrite to events from older ox versions.
- It ships as its own PR, first. It is a different subsystem, and it does not need to wait for the SageOx endpoint.
## Ruled out
The review removed several ideas from the first draft. Each row says why.
| Idea | Why not |
| --- | --- |
| Send reports through the typo reporter | It is fire-and-forget and holds events in memory. Its server only accepts typo events, and nobody reads individual ones. |
| Send reports as product analytics events | Analytics turns off when the person opts out of telemetry. Events are capped at 4 KiB and are anonymous, so nobody could follow up. |
| Open a public GitHub issue for the person | Reports would be public. The tracker's terms grant SageOx a copyright licence to any code inside. |
| Report as an argument: `ox feedback "text"` | Any mistype sends the arguments through the typo reporter. Arguments also show up in shell history and process lists. |
| A setting to send without asking (ask / auto / off) | A setting modelled on `plan.open` could be committed to the repo. Its "always" value is set by the AI coworker running `ox config set`. Either could turn consent off silently. It becomes a follow-up, limited to the person's own config. |
| Attach a link to the session | The link points at the whole live session, not just the report. It waits for a SageOx policy on who may open it. |
| A separate `ox guide feedback` page, a skill file, a `--kind` flag | They repeat what help and guidance already say. Skills do not reach Codex and other hosts. |
| Detect IP addresses, card numbers and social security numbers | They are rare in ox bug reports and produce many false matches. They are added only if real reports show the need. |
## Proof
Each customer promise gets an end-to-end test that drives the real command against a fake SageOx server. Each test is shown failing first, with a deliberate break, then passing. The PR reports both runs.
| Promise | The test observes | Deliberate break for the red run |
| --- | --- | --- |
| A credential never reaches SageOx | A planted key is refused. It is absent from stdout, stderr, and the fake server's request body. | Skip the credential check |
| Nothing is sent without a confirmed preview | `printf 'y\n' \| OX_YES=1 ox feedback --file r.md` reaches no server. Neither does `--yes`. | Use the shared confirm helper that honours `--yes` |
| What is sent equals what was previewed | Editing the report after the preview returns `preview_changed`, and nothing reaches the server. | Drop the fingerprint check |
| Identifying details are replaced | The server body holds `[email]`, `~` and `[repo-remote]`, never the originals. | Skip the replace step |
| Mistyped feedback commands do not leak | Three mistypes carrying a planted value produce no typo report at all. | Remove the bypass |
| AI coworkers can find it | The prime row is present and under budget. The prompt hint fires on the listed phrases, and not on "ox plan feedback". | Remove the row; empty the phrase list |
The promises are also written as a customer-facing acceptance file. The PR names the Go test behind each rule. Before merge, run `/security-review`, because the PR touches the redaction boundary.
## Work breakdown
PR A · typo-report privacy fix
Rewrite typo reports so only command words and flag names leave. Apply it in the CLI and at the daemon. Correct the privacy record and the friction spec. About 150 lines of Go and 250 of tests. Merge any time.
PR B · ox feedback
The checks, the command, the API client, the prime row, the prompt hint, help, tests, generated docs and CHANGELOG. About 1,000 lines of Go and 1,700 of tests. Merge once the endpoint is live.
Outside this repo · SageOx endpoint
A signed-in endpoint that accepts a report and returns a receipt. It needs size limits, a per-account rate limit, duplicate protection, and a handling policy. Tracked separately.
Two PRs instead of one because they touch different subsystems and merge at different times. PR B does not depend on PR A's code.
## Risks and follow-ups
| Risk | What reduces it |
| --- | --- |
| A prompt-injected AI coworker confirms on its own | Hard limits on every report. A per-account rate limit on the server. A person-verified approval step later. |
| The random-token rule refuses harmless text, causing retry loops | Git hashes, UUIDs and ox ids are allowed by name. A false-match test corpus pins the thresholds. Guidance says stop after two refusals. |
| Claude Code AI coworkers never see the prime row | The prompt hint and `ox --help` carry discovery. An evaluation case can measure uptake later. |
| The endpoint is not live when PR B is ready | Hold the merge. An unknown endpoint maps to `not_supported` with "do not retry". |
| The name changes after the build | Ask Ryan first (question 1). |
### Follow-ups to file
- A person-verified approval step for reports an AI coworker relays.
- A send-without-asking setting, limited to the person's own config and settable only at a terminal.
- Opt-in session links, after SageOx sets an access policy.
- Import's publish check misses about 147 of the credential rules. Switch it to the full rule set this plan adds.
- IP, card-number and SSN detection, only if real reports need it.
- A "still failing? offer `ox feedback`" line after `ox doctor` leaves a check unfixed.
<!-- ox:details -->
Implementation notes
### Files
| File | Change |
| --- | --- |
| `cmd/ox/feedback.go` (new) | Command, flags, check order, consent flow, envelopes, help text, guidance constants. `GroupID = "diagnostics"`; self-registers in `init()`. |
| `internal/feedback/` (new) | Pure guard: block layer, code-line count, replacements, normalization, `preview_id`. One function returns the only transmittable string or a refusal. |
| `internal/session/redact_rules.go`, `secrets.go` | Add `NewFullRedactor(projectRoot)` and `(*Redactor).Findings(input)`. |
| `internal/api/feedback.go` (new) | `SubmitFeedback`, modelled on `PublishBulletinPost`. |
| `cmd/ox/main.go` | `feedbackInvocation(args)` friction bypass in `executeWithFrictionRecovery`. |
| `internal/prime/guidance.go`, `directives.go` | One `IntentCommand` row after the doctor row; directive marker. |
| `cmd/ox/agent_hook.go` (+ new hint file) | Phrase hint next to `emitPlanHint`. |
| `cmd/ox/root.go` | Root-help footer line. |
| `docs/adr/008-privacy.md` | Privacy Summary Matrix row for feedback. (PR A also corrects the arguments claim in the never-collect table, `:103`, and in the 2026-09-10 audit note, `:39-42`.) |
| `.github/workflows/security-review.yml` | Add `internal/feedback/**` to the sensitive-path filter. |
| `CHANGELOG.md`, `docs/reference/` | New + Privacy bullets under Unreleased. Regenerate reference docs (`feedback.mdx`; sidebar positions after it renumber). |
| `tests/acceptance/features/feedback/send-feedback.feature` (new) | Customer promises; README structure line; glossary note that "feedback" has two meanings. |
| PR A: `cmd/ox/friction.go`, `internal/daemon/friction.go`, `docs/specs/friction-api-spec.md` | Structural rewrite of `Input`/`ErrorMsg` before send and at daemon ingest; doc corrections; `telemetry` setting text. |
### Command shape and check order
- Usage: `ox feedback [--file <path>|-] [--confirm <preview_id>] [--json]`. No positionals, no free-text flags, no `--title`.
- `Args: cobra.ArbitraryArgs`; RunE refuses `len(args) > 0` first with a `usage_error` envelope (code `positional_not_allowed`) and returns `errkind.WithDetail(errkind.Usage, "positional_not_allowed", &commandExitError{ExitCode: 2})`. Precedent: `conversation.go:225-232`. Never `cobra.NoArgs`: its message embeds `args[0]`, and friction parses "unknown command".
- `--file` reads regular files only, or stdin on `-`, through `io.LimitReader(cap+1)`. Valid UTF-8, no NUL, not blank. A leading BOM is stripped. Title = first non-blank line, truncated to 120 chars.
- Bare `ox feedback` (no `--file`) never reads stdin. It prints the discovery page and exits 0; JSON is `{status:"usage", sent:false, guidance}`. If stdin is a pipe or regular file, lead with "Nothing was sent. To read the report from stdin, add --file -."
- Default to JSON when agentx detects an AI coworker (precedent `session_import.go:253-256`).
- Order: (1) positional → `usage_error`; (2) `startedByOx` → `nested_ox`; (3) no `--file` → discovery; (4) token for `endpoint.GetForProject(gitRoot)` via `EnsureValidTokenForEndpoint`, else `not_logged_in`; `oxt_` → `team_token`; (5) read + validate → `too_large`/`invalid_input`; (6) guard; (7) consent; (8) send. Local preconditions run before any preview, so a person never approves an unsendable report.
- Envelope: `{status, sent, error, message, guidance, preview?, preview_id?, next_command?, receipt_id?, findings?}` through `cli.PrintJSONTo`. Failures via `silentFailure` with fixed codes. Exit 0 for usage/preview/sent, 2 for usage_error, 1 otherwise.
### Guard details
- The guard's output is the only transmittable string. Panic, error or empty output → `guard_failed`, nothing sent (cloud-query invariant, `agent_hook_cloud_query.go:143-156`).
- `NewFullRedactor` = `DefaultPatterns` + `LoadCustomPatterns` + `DefaultExtraDetectors` + `generatedGitleaksDetectors`, same catalog as session capture (`raw_writer.go:76-95`). Error on any REDACT.md parse error (as `raw_writer.go:308-311`) → `redaction_rules_invalid`.
- `Findings(input) []Finding{Name, Source, Line}` scans the *original* input pattern by pattern, honours `Keywords`/`SkipIf`, returns no bytes. Do not use `RedactStringWithDetails`: `Original` holds raw bytes and `Position` indexes the rewritten string (`secrets.go:576-614`).
- **Gotcha:** builtin patterns have an *empty* `Source`; `RuleSourceBuiltin` is declared but never assigned (`secrets.go:14`, `redact_rules.go:19`). Block unless `Source ∈ {team, repo, user}`.
- Feedback-only block layer (leave the signed `DefaultPatterns` manifest untouched): (a) gitleaks `private-key` regex verbatim, case-insensitive — catches ENCRYPTED and PGP keys that `secrets.go:317` misses; (b) opaque tokens: 24+ chars of `[A-Za-z0-9+/=_-]`, ≥3 character classes, Shannon entropy ≥ 4.0; allow pure hex, UUIDs, `ses_`/`cnv_`/`rec_`/agent ids; (c) prose credentials: `password|passphrase|api key|secret|token` + `is|was|=|:` + a 6+ char value with a digit or mixed case.
- Invisible: any Unicode Cf or bidi control (ZW*, LRM/RLM, U+202A–202E, U+2066–2069, U+FEFF after the leading BOM) → refuse.
- Code lines: fenced blocks plus lines indented by 4 spaces or a tab, counted across the body; > 30 → `too_much_code`. No per-line heuristic (false matches on JSON and stack traces).
- Replacements: custom-rule hits → fixed `[REDACTED_TEAM_RULE]` (team labels can carry business detail). Team context not synced → proceed with repo and user rules; preview shows `team_rules_applied: false`. Identity literals: case-sensitive, word boundaries, ≥ 4 chars; deny list `ox, sageox, root, user, admin, localhost, git, dev, main`. Emails: known identity values first, then a regex.
### Consent mechanics
- Inline y/N only when: no AI coworker detected, no `--json`, `cli.IsInteractive()`, stdout is a terminal, body from `--file <path>`. Use `cli.ConfirmYesNo("Send this to SageOx?", false)`. Never `ConfirmYesNoRequired` (returns true on `--yes`, `confirm.go:212-216`) or `bulletinShouldConfirm` (sends without asking when not interactive, `bulletin_input.go:360-365`).
- **Gotcha:** Claude Code's Bash tool gives stdin as `/dev/null`, a character device that is not a tty. `isatty` calls it non-interactive; the `ModeCharDevice` check in `internal/decision/input.go:42-55` calls it a terminal. Use `isatty` only.
- `--confirm` is read directly, never via `cli.AssumeYes()`.
- `preview_id = fbp_<16-char random nonce>_<first 32 hex of sha256(nonce ‖ canonical JSON of the outgoing payload)>`. The payload is `title, body, replaced, team_rules_applied, consent` after the guard, so a team-rule sync between calls changes the id and yields `preview_changed`. Derive the title from the guarded body, never the raw input. Normalize the body first: CRLF→LF, trim trailing spaces/tabs per line, trim trailing blank lines. The id is an integrity check, not a secret. Stateless: `--confirm` re-runs the guard and recomputes. Mismatch → `preview_changed` with a fresh preview. The id is also the `Idempotency-Key`.
### Transport
- Copy `PublishBulletinPost`: `endpoint.GetForProject`, `EnsureValidTokenForEndpoint`, `useragent.NewRequest`, no-redirect client clone, `CheckVersionResponse`, `LimitReader`, one refresh on 401, never log bodies, hostile error bodies safe.
- Success only on 201 with a receipt id matching `^[A-Za-z0-9_-]{6,64}$`. No automatic retries. Server text never enters guidance (`bulletin.go:156-157` precedent).
- Mapping: 401 after refresh → `not_logged_in`; 404 → `not_supported`; disabled → `not_enabled`; 400/413/422 → `server_rejected`; 429 → `rate_limited`; 5xx/timeout → `unavailable`; dial failure → `network_error`.
- Body fields: `title, body, consent, replaced, team_rules_applied`. Context rides the headers `useragent.SetHeaders` already sets (User-Agent, X-Client-Type, X-Orchestrator, X-Sageox-Repo-Id, traceparent); the preview names each. Never sent: email, name, paths, branch, remote URL, hostname, session title, daemon LastError, logs, install_id.
### Friction bypass (PR B) and rewrite (PR A)
- PR B: a new `feedbackInvocation(args)`, separate from `headlessLedgerReadRequested` (that one also gates dotenv, feature flags and its own error schema, `main.go:137,216,251,284-291`). Match when `rootCmd.Find(args)` returns `feedbackCmd` (pointer compare, so `ox plan feedback` is unaffected) or `agentCmd` with `feedback` among the first two positionals. Place it after the commandExitError/interrupt/headless checks and before `frictionEngine` (`main.go:293-299`). Print the pflag error (names only the flag) or the fixed agent-namespace pointer; JSON when `--json` is in args; exit 2.
- PR A: before `sendFrictionEvent`, rewrite `Input` to the resolved command path plus flag names (strip `=value`); every value and positional → `<arg>`. Keep the first unresolved token only if it matches `^[a-z][a-z-]{0,31}$` and `Findings()` reports nothing for it. (Every ox command name is lowercase letters and hyphens; a looser pattern would admit key ids and passwords.) Rebuild `ErrorMsg` from the parsed kind with the same token rule. Apply the same rewrite at daemon ingest for older CLIs. Why structural: the frictionax adapter matches "unknown command", "unknown flag:", "unknown shorthand flag:", "required flag" and "invalid argument" by substring on any error, including ox-authored ones (`agent.go:308,663`).
### Tests
- `internal/feedback`: secret corpus (reuse `secrets_test` fixtures + ENCRYPTED/PGP keys, headerless key body, prose passwords, opaque tokens, ZWSP/bidi); false-match corpus (git SHAs 7–40, sha256 OIDs, UUIDs, trace ids, ox ids, versions, Go stack traces, `ox doctor` output, a user named `ox` or `dev`, bare prefixes like `oxt_`); code count; size cap; each replacement; normalization; never-echo.
- `internal/session`: `NewFullRedactor` errors on bad REDACT.md; `Findings` lines correct after multi-line matches.
- `internal/api/feedback_test.go`: exact JSON keys, Idempotency-Key, no redirects, hostile error bodies, 201-only, malformed receipt id rejected.
- E2E with the `newBulletinCommandHarness` pattern: stdin `/dev/null`, empty pipe, non-empty pipe without `--file`; positional refusal; `OX_YES`/`--yes`/piped `y` send nothing; confirm round trip and `preview_changed`; inline prompt defaults to No; not-logged-in returns before preview; friction capture empty for `ox feedback --mesage <seed>`, `ox feedback <seed>`, `ox agent Oxa7b3 feedback <seed>` (use `sendFrictionEventTo` with a test socket).
- Guidance table test: every not-sent constant ends with the no-reroute suffix; none contains `github.com` or matches `\bgh\b`.
- Prime: row present and placed after doctor; directive `{Name: "command table: feedback", Marker: "ox feedback"}`; `TestPrimeTokenBudget_FullAndCompactStayUnderCeiling` stays green. Phrase hint: listed phrases match; "ox plan feedback", "inbox bug", "feedback about oxygen" do not.
- PR A: planted values in `ox murmur`, `ox feedbak`, `ox plan feedback resolve --note`, `ox agent tasks add --title` never appear in the captured payload; the typo token does.
### Evidence
| Claim | Where |
| --- | --- |
| Friction sends raw argv (500 chars) and error text (200) with a no-op redactor | `cmd/ox/main.go:288-303`, `cmd/ox/friction.go:31-38`, `internal/daemon/friction.go:54-70`, frictionax v0.1.2 `frictionax.go:224` |
| ADR-008 says arguments are never collected | `docs/adr/008-privacy.md:96-107`; spec claim at `docs/specs/friction-api-spec.md:356-358` |
| Prime budget 3,505 / 3,700; commands rank 19 of 28 under the hook cap | `cmd/ox/agent_prime_reprime_test.go:97-155`, `cmd/ox/agent_prime_hookcap.go:14-106` |
| No deterministic PII detection exists; `internal/redaction` is an unused LLM redactor | `internal/redaction/redaction.go:41-198`; no importers |
| Credential catalog and its gaps | `internal/session/secrets.go:52-453`, `raw_writer.go:76-102`, `gitleaks_generated.go:24`, `internal/session/cmd/gitleaks-port/main.go:23-26` |
| Never echo matched bytes | `cmd/ox/prepush_scan.go:31-39`, `doctor_ledger_secrets.go:22-33` |
| Shared confirm helpers accept piped answers and `--yes` | `internal/cli/confirm.go:194-241` |
| `plan.open` is repo-scoped and self-escalating | `cmd/ox/config_settings.go:379-403`, `cmd/ox/agent_hook_plan_nudge.go:260` |
| "Feedback" is reserved plan-review vocabulary pending Ryan | `docs/adr/ADR-025-plan-annotation-and-feedback-delivery.md:1-8` |
| Help names no place to report a bug (HELP-7, ERR-4 not met) | `docs/adr/ADR-034-cli-guidelines-baseline.md:302-303,730` (HELP-7); `:505-509,739` (ERR-4) |
| Public tracker copyright grant | `CONTRIBUTING.md:66-68` |
| Bulletin transport pattern to copy | `internal/api/bulletin.go`, `cmd/ox/bulletin.go:180-221,282-289,596-785` |
<!-- /ox:details -->
enriched by

