Primary finding
API key written into request headers but config file permissions never checked; key may leak via stderr on HTTPError
- agenticbets/scripts/agenticbets.py:56-60
On HTTPError the entire response body is dumped to stderr. If the Bankr API ever echoes the X-API-Key header (some gateways do) or includes it in an error trace, the secret leaks into logs. Lower-confidence finding because it depends on the upstream's behavior; still, a safer pattern is to truncate/scrub the body or print only e.code+e.reason on auth failures (401/403).
Recommendation
On 401/403, print only the status and a fixed remediation hint. Otherwise truncate body_text and redact any `bk_` substrings.