# Security Policy & Deterministic Verification Boundary

> **SSOT Reference**: [`spec/fiderail.manifest.json`](./spec/fiderail.manifest.json) · [`docs/01-scope-and-boundaries.md`](./docs/01-scope-and-boundaries.md)  
> **Source Repositories**: [GitHub](https://github.com/fiderail/fiderail) · [GitLab (Primary)](https://gitlab.com/fiderail/fiderail)

## Constitutional Security Boundaries
1. **100% Non-Custodial (`ZERO_CUSTODY`)**: FideRail **never holds, custodies, or accesses** user private keys, session keys, or funds, and never operates as a centralized custodial facilitator, lending pool, or underwriting pool. All signing executes strictly inside the caller's own environment.
2. **No Platform Token (`ZERO_TOKEN`)**: FideRail never issues a token or requires token holdings.
3. **Zero Human Arbitration (`ZERO_HUMAN_ARBITRATION` / `CODE_IS_LAW`)**: Maintainers never manually adjudicate payment disputes or hand-edit individual wallet scores. Every score, risk flag, and pre-flight decision is computed deterministically from public on-chain data, verifiable endpoint diagnostics, and open-source model code.

## Reporting a Security Vulnerability
If you discover a security vulnerability in FideRail's firewall logic, SSRF/DNS protections, outbound secret scrubber, capability validation, indexer, or public API (`https://api.fiderail.com`), please report it privately before public disclosure:

- **Security Contact**: `security@fiderail.com`
- **Website**: `https://fiderail.com`
- **Primary Source Repository (GitLab, MIT)**: [https://gitlab.com/fiderail/fiderail](https://gitlab.com/fiderail/fiderail)
- **Mirror Repository (GitHub, MIT)**: [https://github.com/fiderail/fiderail](https://github.com/fiderail/fiderail)

Please include reproduction steps, affected files or endpoints, and potential impact. We aim to acknowledge reports within 48 hours.

## Reproducible Model Bug Reports & Flagging Reviews
Because FideRail enforces **zero manual score overrides**, maintainers will not manually whitelist a wallet or edit its score. However, if you believe a deterministic scoring rule or endpoint classifier contains a software bug (for example, misclassifying a legitimate batch relayer pattern):

1. Reproduce the behavior against the open-source scoring engine ([`docs/03-trust-model.md`](./docs/03-trust-model.md)) or run the zero-payment endpoint grader (`POST /v1/diagnose`);
2. Submit a reproducible test case or technical report to **`security@fiderail.com`** (or open a public issue on [GitLab Issues](https://gitlab.com/fiderail/fiderail/-/issues) or [GitHub Issues](https://github.com/fiderail/fiderail/issues)) containing chain, address, and verifiable transaction/endpoint evidence so any verified algorithmic flaw can be fixed uniformly in code for the entire network.

## Outbound Secret Scrubber Threat Model
`scanOutboundSecrets()` (enabled by default in `@fiderail/guard` and Python `guarded_x402_request`) uses deterministic regular expressions to catch **accidental plaintext leakage** of common credential formats (API keys, PEM private keys, JWTs, and labeled seed phrases) in outbound URLs, headers, and request bodies before transmission.

- **Scope**: It is an **accidental-leakage guardrail**, NOT an adversarial exfiltration sandbox.
- **Limitation**: Deterministic pattern matching cannot stop an active prompt-injection attack that instructs an LLM to encode, reverse, split, or obfuscate credentials already present in its prompt context.
- **Required Hygiene**: Never pass high-privilege API keys, wallet private keys, or seed phrases into an untrusted LLM's context window; keep signing keys strictly isolated in local edge processes outside model visibility.
