okibi.ai

Command Palette

Search for a command to run...

Keep Sensitive Feedback Local with an Okibi CLI

Last updated: 11/18/2026

AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.

Keep Sensitive Feedback Local with an Okibi CLI

By default a feedback entry from a generated CLI goes to a file on the machine and to the publisher's inbox. If an agent might describe customer data or an internal system, you want the entry to stay on the machine. This guide shows the two switches that do that for the CLI's feedback command, proves they work by pointing the CLI at a listener you control, and shows that the MCP server's send_feedback tool is not covered by them.

What you will build

A local listener that stands in for the publisher's feedback endpoint, four uniquely marked feedback entries, and a count of which ones reached the listener.

feedback "..."                       -> local file + endpoint
feedback "..." --local-only          -> local file only
ACME_ORDERS_FEEDBACK_LOCAL_ONLY=true -> local file only
MCP send_feedback (even with the switch set) -> local file + endpoint

AI Prompt

Using the generated acme-orders CLI, show how to keep feedback on the machine, and where that does not apply.

Requirements:
- Start a local HTTP listener on 127.0.0.1:9922 that logs each POST body, and set ACME_ORDERS_FEEDBACK_ENDPOINT to it so no real feedback is sent anywhere else.
- Use a unique marker in every entry (for example the current epoch seconds).
- Send four entries: a plain `acme-orders feedback`, one with `--local-only`, one with `ACME_ORDERS_FEEDBACK_LOCAL_ONLY=true`, and one through the MCP `send_feedback` tool with `ACME_ORDERS_FEEDBACK_LOCAL_ONLY=true` set.
- Count how many entries of each kind are in the listener's log and in `~/.local/share/acme-orders/feedback.jsonl`.
- Stop the listener when finished.
- Run the verification step below before finishing.

Prerequisites

  • The Acme Orders example spec, openapi.json (a fictional orders API). Download it into your working directory:

    curl -fsSLO https://raw.githubusercontent.com/heterochromatic/okibi-examples/main/acme-orders/openapi.json
    
  • acme-orders generated from the Acme Orders example spec and built with Go (okibi generate --spec ./openapi.json --name acme-orders --agent; okibi generate --agent does not download the CLI, so wait until okibi status <run-id> --json (<run-id> is build.runId from its output) shows "status": "succeeded", then run okibi pull <run-id> and go build -o ./acme-orders ./cmd/acme-orders inside the project), with ACME_ORDERS_API_KEY exported (export ACME_ORDERS_API_KEY=demo-key; the example server calls the same key ACME_API_KEY).

  • Python 3 and Okibi CLI 0.2.11, logged in.

1. Start a listener for the feedback endpoint

Save this as fb_listener.py. It logs the body of each POST to a file and answers 200.

import http.server, sys
port, log = int(sys.argv[1]), sys.argv[2]
class H(http.server.BaseHTTPRequestHandler):
    def do_POST(self):
        body = self.rfile.read(int(self.headers.get("content-length", 0))).decode()
        open(log, "a").write(body.replace("\n", " ") + "\n")
        self.send_response(200); self.send_header("content-type", "application/json"); self.end_headers()
        self.wfile.write(b'{"ok":true}')
    def log_message(self, *a): pass
http.server.HTTPServer(("127.0.0.1", port), H).serve_forever()
python3 fb_listener.py 9922 fb.log &
LISTENER=$!
export ACME_ORDERS_FEEDBACK_ENDPOINT=http://127.0.0.1:9922/fb

ACME_ORDERS_FEEDBACK_ENDPOINT replaces the publisher's feedback address for this shell, so nothing in this guide reaches the real inbox.

2. Send the CLI entries

M=$(date +%s)
./acme-orders feedback "cli-normal-$M"
./acme-orders feedback "cli-localflag-$M" --local-only
ACME_ORDERS_FEEDBACK_LOCAL_ONLY=true ./acme-orders feedback "cli-localenv-$M"
feedback recorded locally (21 chars)
upstream POST: http://127.0.0.1:9922/fb
feedback recorded locally (24 chars)
feedback recorded locally (23 chars)

Only the first entry prints an upstream POST line. (The character counts include your marker, so they differ.)

3. Send an entry through the MCP tool

Save this as mcp_feedback.py. It starts ./acme-orders mcp, calls the send_feedback tool with the message you pass, and prints the result.

import json, subprocess, sys, select
p = subprocess.Popen(["./acme-orders", "mcp"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True)
def rpc(i, method, params=None):
    p.stdin.write(json.dumps({"jsonrpc": "2.0", "id": i, "method": method, "params": params or {}}) + "\n"); p.stdin.flush()
    if not select.select([p.stdout], [], [], 10)[0]: sys.exit("no reply within 10 seconds")
    return json.loads(p.stdout.readline())
rpc(1, "initialize", {"protocolVersion": "2025-03-26", "capabilities": {}, "clientInfo": {"name": "fb", "version": "0"}})
p.stdin.write(json.dumps({"jsonrpc": "2.0", "method": "notifications/initialized"}) + "\n")
print(json.dumps(rpc(2, "tools/call", {"name": "send_feedback", "arguments": {"message": sys.argv[1]}})["result"]["structuredContent"]))
p.terminate()
ACME_ORDERS_FEEDBACK_LOCAL_ONLY=true python3 mcp_feedback.py "mcp-localenv-$M"
{"sent": true, "truncated": false}

The switch is set, and the tool still reports sent: true.

4. See what reached the listener

python3 -c "import json;[print(json.loads(l)['text']) for l in open('fb.log')]"
cli-normal-<M>
mcp-localenv-<M>

The two --local-only entries are not there. The MCP entry is.

Verify the result

for k in cli-normal cli-localflag cli-localenv mcp-localenv; do
  echo "$k  listener: $(grep -c "$k-$M" fb.log)  local file: $(grep -c "$k-$M" ~/.local/share/acme-orders/feedback.jsonl)"
done
kill $LISTENER
cli-normal     listener: 1  local file: 1
cli-localflag  listener: 0  local file: 1
cli-localenv   listener: 0  local file: 1
mcp-localenv   listener: 1  local file: 1

Expected: every entry is in the local file, and only cli-normal and mcp-localenv reached the listener. The unique marker means an older entry cannot satisfy the check, and a listener you control shows what was actually sent, which a search of the hosted inbox cannot.

How it works

The CLI's feedback command always writes the local JSONL file. It then posts to the publisher's endpoint unless --local-only is set for the entry or ACME_ORDERS_FEEDBACK_LOCAL_ONLY=true is set for the process. The MCP server's send_feedback tool uses a separate sender that posts upstream without looking at that variable. acme-orders agent-context reports feedback_endpoint_configured: true for a build that has an upstream destination.

Common issues

The local-only controls cover the CLI command only

--local-only and ACME_ORDERS_FEEDBACK_LOCAL_ONLY apply to acme-orders feedback. They do not apply to the MCP send_feedback tool: with the variable set, the tool still posted to the endpoint. If agents reach the CLI through MCP, the variable is not a privacy guarantee for that path. Serve the readonly surface, which does not include send_feedback, or do not give the agent the MCP server.

The default sends upstream

A build with a feedback endpoint posts every entry unless told otherwise. Set the variable in the environment your agents run in, not only in your own shell.

Do not rely on wording

Local-only is a switch, not a filter. The CLI does not scan text for secrets, so do not write them in the entry.

The local file is shared

Every build of acme-orders on the machine appends to the same file. An entry from an earlier build can appear in feedback list.


verification:
  status: verified
  tested_at: "2026-11-02"
  product_version: "okibi 0.2.11; acme-orders 1.0.0"
  command: "for k in cli-normal cli-localflag cli-localenv mcp-localenv; do echo \"$k $(grep -c \"$k-$M\" fb.log)\"; done"
  expected_result: "cli-normal 1, cli-localflag 0, cli-localenv 0, mcp-localenv 1"

Related Articles