Keep Fentaris deployments safe with centralized identity, policy, secrets, and audit controls.Start with allow-list policy, authenticated users, scoped upstream servers, and structured logging. Add runtime middleware only for checks that depend on request data.
Quick Start
Declare the proxy with high-level helpers and keep security rules close to the upstream MCP server they govern.Guard Destructive Tools
Policy should block known destructive tools before runtime middleware runs.Govern All MCP Capabilities
Tools are only one MCP surface. Resources, resource templates, prompts, and completion can expose data or shape model behavior.resource:read, prompt:get, and completion:complete before Fentaris forwards a request upstream.
Scope Servers Per Group
Use groups to make server access explicit. This keeps tool visibility, credentials, and policy tied to the caller.Compose App-Level Policy And Groups
For incremental proxy setup, declare policies and groups from the app handle beforestart().
Protect Secrets
Bind secrets through credentials or environment injection. Do not pass secrets through user-controlled metadata or tool arguments.Store production secrets in your infrastructure secret manager and inject them at deploy time. Keep
.fentaris/credentials.enc.json private when using local encrypted credentials.auth, resolveHeaders, or an explicit envHeaderMap so token-like variables such as GITHUB_TOKEN are not sent upstream unless you map them deliberately.
Validate Identity
When users declare API keys, Fentaris uses API-key identity by default with thex-fentaris-api-key header. Store API keys as credential sources, such as environment variables or encrypted local credentials, instead of literal strings in code.
For named incoming keys, configure projectVaultIdentityStrategy({root: process.cwd()}) and create a client key:
Audit Decisions
EnableautoLog and add stable tags for traceability. Logs should include metadata, not raw payloads or secret values.
Govern Edge Orchestration
Keep Edge Control disabled unless an agent needs inventory or explicit orchestration. When enabled, grantedge__list, edge__get, edge__select, edge__call, and edge__call_many independently.
For high-impact fan-out, configure aggregate approval against the exact resolved public-device scope, bounded argument summary, failure policy, concurrency, and deadline. Every child still re-enters normal tool policy and local recipe, grant, and executable consent checks after aggregate approval.
Treat device descriptions, tags, observed facts, and MCP child output as untrusted data. Do not accept route, device, correlation, or status fields from device output. Keep device credentials, opaque node IDs, private paths, grant references, secrets, and complete environments out of agent-visible results and telemetry.
Use durable multi-instance adapters in production. Atomic inventory versions, monotonic connection generations, sticky/round-robin coordination, atomic result consumption, bounded expiry, and idempotent terminal correlation are security boundaries, not only availability optimizations.
Protect the integrated Edge authority
Treat.fentaris/edge-control-plane as credential-bearing authority state. Keep the directory and files owner-only, exclude them from version control and backups that lack equivalent encryption, and set FENTARIS_AUTH_KEY from a secret provider. Approval must use fentaris edge approve; never edit authority JSON directly.
Set an explicit HTTPS publicOrigin behind the trusted TLS terminator. Fentaris ignores hostile Host and forwarded headers when generating join and gateway URLs. Keep the reserved Edge route separate from the MCP path, restrict operator socket access to the application owner, and rotate credentials after suspected disclosure.
Local mode is rejected for unsafe multi-instance use. Production replicas need managed adapters with tenant isolation, compare-and-swap desired assignments, monotonic connection generations, durable revocation, and consistent authorization services. Adapter errors fail closed: they must never broaden eligibility or dispatch.
Harden Network Exposure
Run public Fentaris deployments behind a reverse proxy or cloud load balancer.- Terminate TLS at the edge and forward only HTTPS traffic.
- Restrict inbound access with private networks or IP allow-lists.
- Keep upstream MCP servers private when possible.
- Rotate API keys and upstream credentials regularly.
Low-Level API
The class constructors remain available for compatibility and advanced embedding. Preferfentaris(...), mcp(...), stdio(...), streamableHttp(...), group(...), user(...), and policy(...) for new applications.
Inbound OAuth
SetoauthIdentityStrategy with an exact issuer and externally visible resource audience. Use HTTPS outside loopback. Fentaris verifies asymmetric JWT signatures, expiry and optional nbf with 60 seconds of skew, and every required scope. It rejects unverified tokens without exposing verifier errors in responses.
verify is the trust boundary for opaque tokens: authenticate introspection calls, require an active token, use a bounded timeout, and return issuer, audience and expiry claims. Fentaris applies the same claim checks afterward. Sessions remain bound to the resolved user and identity strategy.
Fentaris serves protected resource metadata, while authorization, token issuance and client registration remain on the configured issuer. See OAuth 2.1 for JWKS caching and reverse-proxy configuration.