agentleFS
OpenBMBOpenBMB/EC2-Bench/skills/cloud-router/SKILL.md

cloud-router

Skill19 starsChanged 5 months agoMITView on GitHub

A transparent OpenAI-compatible HTTP proxy that intercepts every chat completions call OpenClaw makes, decides per round whether to keep the call local or escalate to the cloud, and (when escalating) redacts PII through a small local detector LLM. Cloud responses are reverse-mapped back to the original tokens before they reach the agent, so the agent runs as if no proxy existed. The proxy keeps per-session state: - original_ctx full PII-bearing history (used to detect incremental rounds) - clean_ctx redacted history…

  • Reads credentials

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every cloud call appends one JSONL line to AUDIT_FILE.

    line 45

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

cloud-router

A transparent OpenAI-compatible HTTP proxy that intercepts every chat completions call OpenClaw makes, decides per round whether to keep the call local or escalate to the cloud, and (when escalating) redacts PII through a small local detector LLM. Cloud responses are reverse-mapped back to the original tokens before they reach the agent, so the agent runs as if no proxy existed.

Files

  • privacy_proxy.py — FastAPI service, listens on ROUTER_PORT (default 9303).
  • start_router.sh — install deps, export env vars, launch the proxy in background.
  • tap_proxy.py — old experimental tap (verifies how OpenClaw assembles messages[]).
  • start_tap.sh — launches tap_proxy.py (used by 08_Toy_task_3_tap_messages.md).
  • prompts/judge.md — local LLM prompt: edge-vs-cloud routing decision.
  • prompts/redact.md — local LLM prompt: PII detection for redaction.

Architecture

OpenClaw → proxy:9303 ── judge → local? ── yes ─→ edge vLLM ─→ proxy → OpenClaw
                              └ no  ─→ redact ─→ cloud LLM ─→ unredact ─→ OpenClaw

The proxy keeps per-session state:

  • original_ctx full PII-bearing history (used to detect incremental rounds)
  • clean_ctx redacted history sent to the cloud (preserves cloud prompt cache)
  • token_map {original → placeholder} accumulated across the session

Redaction is lazy and incremental — local-only rounds skip redaction; the first round that escalates to the cloud "catches up" on every history message that has not been redacted yet.

Required env vars (set by eval/run_batch.py for --run-mode router)

  • CLOUD_BASE_URL, CLOUD_API_KEY, CLOUD_MODEL
  • EDGE_BASE_URL, EDGE_API_KEY, EDGE_MODEL
  • (optional) JUDGE_BASE_URL / JUDGE_API_KEY / JUDGE_MODEL — defaults to edge
  • (optional) REDACT_BASE_URL / REDACT_API_KEY / REDACT_MODEL — defaults to edge
  • (optional) ROUTER_PORT (default 9303), AUDIT_FILE (default /tmp/cloud_assistant_audit.jsonl)

Audit

Every cloud call appends one JSONL line to AUDIT_FILE. The input field contains the clean (redacted) messages that actually reached the cloud — it is what utils/privacy_audit.py scores against the sensitive_items.json ground truth.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.