Documentation Index
Fetch the complete documentation index at: https://authsome.mbajaj.me/llms.txt
Use this file to discover all available pages before exploring further.
authsome run is the most secure way to give a subprocess access to credentials. Instead of passing tokens through environment variables, authsome starts a local HTTP proxy, points the child process at it, and injects the right Authorization header on the way out.
The child process never sees the raw secret.
The flow
Authsome spawns the child
The subprocess is launched with
HTTP_PROXY and HTTPS_PROXY (and lowercase variants) pointing at the local proxy. Provider-specific placeholder variables like OPENAI_API_KEY=authsome-proxy-managed are also set so SDKs initialize without crashing.Outbound requests are intercepted
When the child makes an HTTP(S) call, mitmproxy decrypts and inspects the request. It looks at the destination host.
The proxy matches by host_url
Authsome iterates the registered providers and matches the request host against each provider’s
host_url field. On a match, it asks the AuthLayer for fresh credentials (refreshing if necessary) and injects the right Authorization header.The request is forwarded
The authenticated request goes to the external API. The response streams back through the proxy unchanged.
Routing contract
Provider definitions declare ahost_url to opt in to proxy injection.
host_url value can be one of:
| Form | Example | Matches |
|---|---|---|
| Bare host | api.github.com | Exact host match |
| Full URL | https://api.github.com | The host portion is extracted |
| Host regex | regex:^api[0-9]+\\.github\\.com$ | A regular expression on the host |
regex: prefix when an API serves multiple hosts that follow a pattern.
Matching rules
- Exact host match is preferred. The first provider whose
host_urlmatches wins. - Ambiguous matches (two providers claim the same host) are not injected. The request is forwarded unchanged. Authsome logs a warning.
- Unmatched traffic is forwarded unchanged. The proxy is transparent for everything it does not recognize.
- The default connection is used for injected credentials. Per-request connection selection is future work.
Why this matters
Compared toauthsome export, which sets environment variables in the child process, authsome run keeps several attack surfaces closed:
| Risk | export | run |
|---|---|---|
Secrets visible in ps//proc/<pid>/environ | Yes | No |
| Secrets visible in shell history | Possible | No |
| Secrets in subprocess env passed to deeper children | Yes | No |
| Long-lived shell session keeps secrets in env | Yes | No |
Known limitations
- Non-HTTP protocols are not intercepted. WebSockets, gRPC, raw TCP database connections, and SSH all bypass the proxy.
- Pinned TLS in some SDKs ignores
HTTP_PROXYor rejects custom CAs. - Host-based routing is fragile if two providers share a base URL. In that case authsome refuses to inject and forwards unchanged.
- Path matching, header matching, and per-request connection selection are not yet implemented.
When to use which
Useauthsome run when:
- The agent calls APIs over HTTP(S) only.
- You want secrets to never enter the child’s environment.
- You can afford to install the mitmproxy CA on the machine running the agent.
authsome export when:
- The tool you are running cannot use an HTTP proxy.
- You are operating in an environment where TLS interception is not possible.
- A short-lived shell needs the credentials directly.