Skip to content

Security

CLI flags containing credentials (--api-key, --api-password) are visible in process listings.

Used for authenticated API access to private wikis. analyze, claim, export, cron, snapshot, watch, review, visualize, explore and delegation accept the flags; diff does not.

CLI flag Sent as
--api-key Authorization: Bearer <token>
--api-user with --api-password Authorization: Basic <base64>

The CLI reads these credentials from the flags only. To keep a token out of shell history and scripts, hold it in a variable of your own and pass it on the command line:

Terminal window
refract analyze "Page" --api https://wiki.example.org/w/api.php --api-key "$MY_WIKI_TOKEN"

The expanded value still appears in the process listing while the command runs.

Two environment variables are read: REFRACT_OAUTH_CLIENT_ID and REFRACT_OAUTH_CLIENT_SECRET. When both are set they are sent as X-OAuth-Client-Id and X-OAuth-Client-Secret headers on every request.

Inference provider auth (refract classify --api-key)

Section titled “Inference provider auth (refract classify --api-key)”

Used only for refract classify to call an LLM at a BYO-inference boundary:

CLI flag Environment variable
--api-key REFRACT_INFERENCE_API_KEY
--endpoint REFRACT_INFERENCE_ENDPOINT
--model REFRACT_INFERENCE_MODEL

When using --cache, revision content is persisted to ~/.wikihistory/refract.db (SQLite). This file contains full wikitext from every revision fetched. On shared machines, set --cache-dir to an encrypted volume.

Refract makes outbound requests to the configured MediaWiki API. Authentication tokens are sent in the Authorization header. Traffic is encrypted when the --api URL is https://; an http:// URL is accepted and sends credentials in the clear.

Bundled evidence files (--bundle) are neither signed nor encrypted — they contain plaintext event data and a SHA-256 hash of their contents, which anyone who edits the file can recompute.

Cached revision data persists indefinitely in ~/.wikihistory/refract.db. Clear it manually:

Terminal window
rm -rf ~/.wikihistory/

There is no automatic data retention policy. The cache only contains data you explicitly fetched.