Skip to content

Anti-ban hardening: trust-score-aware operation, egress policy, and residual wire divergences #140

Description

@trefeon

Context

Full audit of the FreeBuff trust-score system (reverse-engineered from reference/freebuff/ CLI 0.0.149) vs. freebuff-proxy's anti-ban posture. An account used via the SG datacenter VPS was banned after an upstream 403 storm; investigation shows trust system behavior we need to formalize.

Trust system summary (upstream freebuff-trust.ts):

  • Levels: new(0) / verified(25) / established(50) / core(75); DB-failure fail-open = established.
  • Points earn, penalties only CAP: 8 caps — past_enforcement→verified, anonymous_network→verified (live risk ≥75), past_corroborated_egress→verified, third_party_client→verified (sticky foreign tool schema), past_privacy_egress→established, signup_privacy_egress→established, shared_signup_network→established (≥8 per /24), shared_mailbox→verified (≥3).
  • Spend ceilings compose by minimum; SG/CN restricted cohort = $0.50/day with 2× hard cut.
  • ipPrivacySignals wire set: anonymous|vpn|proxy|tor|relay|res_proxy|hosting|service.

Findings

  1. Egress IP class dominates trust exposure. Datacenter/VPN/hosting egress → restricted $0.50 cohort + anonymous_network cap. The SG VPS (Azure hosting ASN) flips a token from full to limited and is the documented ban contributor; residential egress is the only full-tier route.
  2. v0.11.3-era PREFER_MAX_MODELS over-upgrade produced a 403 free_mode_invalid_agent_model storm → upstream escalated to status: banned. Fixed in v0.11.4 (tier-aware gating), but the incident validated the risk class.
  3. Bridge mode + shared-router fan-in (9router → many parallel per-client sessions from one egress) increases fingerprinting correlation; pooled mode centralizes session lifecycle.
  4. third_party_client sticky cap: any non-CLI tool schema on the free-mode wire (agentic clients with custom tools) can cap an account at verified forever + $0.50 cohort. Needs a strategy (tool-schema tolerance mapping to official base2-free schemas?).
  5. Residual wire divergences (audit): (a) ProbeAccount sends x-freebuff-include-unused-rate-limits: 1 — Web/Desktop-only header the CLI never sends, cited against third-party proxies (netroindonesia/quota.js); (b) session/streak/agent-runs/me paths carry ai-sdk UA where the CLI uses bun default (coherent, low risk); (c) stop:["cb_easp"] injection unverified against a live capture.
  6. Proxy RiskEngine + local ledger approximate server trust but cannot see the real level except the pre-join standing block (already surfaced on the dashboard).

Proposed work items

  • P0 Decide/implement residential-egress guidance or enforcement: document Tailscale/WireGuard exit-node pattern for VPS deployments; optionally warn at startup when egress ASN is hosting/datacenter (doctor + startup log).
  • P1 Drop x-freebuff-include-unused-rate-limits from ProbeAccount (internal/upstream/client.go ~1019); read unused limits from full admissions.
  • P1 Streaming/request 403-class escalation guard: when N free_mode_invalid_agent_model/model_mismatch 403s occur in a short window for one token, surface a hard operator warning (webhook event) instead of letting retries amplify.
  • P2 Research third-party-client tool-schema tolerance: map common agent tool schemas (read/write/bash/glob/todo) to official base2-free schemas where possible; otherwise document the sticky-cap risk per client.
  • P2 Session-safety knob: per-egress token cap advisory (≥8 accounts per /24 → shared_signup_network cap) mirrored into -doctor + dashboard.
  • P3 Verify cb_easp stop sentinel against live capture; remove or keep with evidence.
  • P3 Consider surfacing standing/cappedBy/nextSteps from pre-join session on the dashboard tokens page (we already parse it; render it).

References

  • reference/freebuff/common/src/constants/freebuff-trust.ts (+ tests)
  • reference/freebuff/common/src/types/freebuff-session.ts
  • reference/freebuff/common/src/constants/freebuff-spend-ceilings.ts, freebuff-signup-block.ts, cf-worker-signals.ts
  • docs/guides/anti-ban-gap-analysis.md, docs/guides/freebuff-cli-internals.md
  • Proxy: internal/stealth/risk.go, internal/upstream/client.go, internal/pool/pool.go, internal/config/config.go

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions