-
Notifications
You must be signed in to change notification settings - Fork 59
Security
This page covers Milady's security model: network binding, API authentication, config file permissions, and code review security principles.
By default, both the Gateway API server and Dashboard bind to 127.0.0.1 (loopback only). Only processes on the local machine can reach them.
To expose over a network (e.g. in a container or cloud deployment):
MILADY_API_BIND=0.0.0.0 milady startAlways set an API token when binding to a non-loopback address. Without one, anyone who can reach the server has full access to the dashboard, agent control, and all API endpoints.
Generate and set a token:
echo "MILADY_API_TOKEN=$(openssl rand -hex 32)" >> ~/.milady/.envThe token is sent as a bearer token in the Authorization header:
Authorization: Bearer <token>
~/.milady/milady.json is written with mode 0600 (owner read/write only). The ~/.milady/ directory is created with mode 0700. This prevents other users on the system from reading your API keys.
The config supports a $include directive. To prevent injection attacks:
- The API server blocks
$includekeys on all config-write endpoints -
$includedirectives are stripped before any write to disk (stripIncludeDirectivesinsrc/config/config.ts)
All release binaries are signed and notarized. To verify:
cd ~/Downloads
curl -fsSLO https://github.com/milady-ai/milady/releases/latest/download/SHA256SUMS.txt
shasum -a 256 --check --ignore-missing SHA256SUMS.txtmacOS binaries are notarized with Apple. The installer removes the quarantine attribute after copying to /Applications.
From CONTRIBUTING.md: all PRs are treated with adversarial intent until proven otherwise. The review agent checks for:
- Prompt injection vectors
- Credential exposure in code or comments
- Supply chain risks (new npm dependencies, postinstall scripts)
- Data exfiltration patterns
- Subtle behavior changes in auth or permissions paths
- API keys should go in
~/.milady/.envrather than directly inmilady.json -
logging.redactSensitive(default:"tools") redacts sensitive tokens in tool summaries - Never commit real credentials, phone numbers, or live config values to the repo
- Use obviously fake placeholders in docs, tests, and examples
Run the database security tests:
bun run db:checkThis runs src/api/database.security.test.ts, src/api/database.readonly-query-guard.test.ts, and the e2e database API tests.
The codebase includes network-policy (SSRF) tests and memory-bounds test suites in src/security/.
Open a GitHub issue with the category:security label. The agent review pipeline prioritizes security issues.