Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8bf82a6
feat(config): add secret_file_dirs allow-list and upstream secret gua…
james-crowley Nov 10, 2026
1074e19
fix(runtime): detect secret_file_dirs in config hot-reload diff
james-crowley Nov 10, 2026
10e14b1
fix(secret): harden secret_file_dirs policy per security audit
james-crowley Nov 10, 2026
d6484a8
fix(secret): read-time deny identities, swap hooks, apply guard
james-crowley Nov 10, 2026
8a6d56f
fix(serveredition): use proxy-scoped OAuth secret resolution
james-crowley Nov 10, 2026
02af7aa
fix(secret): align CLI resolvers with config secret_file_dirs policy
james-crowley Nov 10, 2026
7ba74f5
docs(config): document secret_file_dirs and upstream secret policy
james-crowley Nov 10, 2026
52cbfa8
fix(secret): reject bad upstream secret refs before save
james-crowley Nov 10, 2026
5fd851e
test(secret): cover pre-save policy and secret_file_dirs reload
james-crowley Nov 10, 2026
8ffa5ad
test(secret): cover GOOS defaults and public policy errors in status
james-crowley Nov 10, 2026
649d759
chore: regenerate OpenAPI artifacts; scope latency test builds agains…
james-crowley Nov 11, 2026
2d0f686
fix(secret): accept Windows drive-root absolute paths
james-crowley Nov 11, 2026
224298d
fix(secret): refuse Windows UNC and device-namespace paths
james-crowley Nov 11, 2026
5dec5c5
fix(config): canonicalize Windows paths in admin-key policy checks
james-crowley Nov 11, 2026
fd42071
Merge origin/main into feat/secret-file-dirs
Dumbris Nov 23, 2026
55cf28c
style(secret): gofmt the secret_file_dirs files
Dumbris Nov 23, 2026
a07a778
fix(secret): refuse hardlinked and superseded proxy files on upstream…
Dumbris Nov 23, 2026
122c481
fix(config): refuse a secret_file_dirs edit when the config file cann…
Dumbris Nov 23, 2026
b6c54dc
fix(appctx): name the loaded config file in the upstream secret deny …
Dumbris Nov 23, 2026
0cae13d
feat(config): warn at startup about upstream ${file:} references outs…
Dumbris Nov 23, 2026
8bf3b1c
style(secret): spell hard-linked for misspell
Dumbris Nov 23, 2026
2143077
fix(upstream): synchronise the secret resolver swap on secret_file_di…
Dumbris Nov 23, 2026
2d86fa4
fix(config): refuse to save secret_file_dirs when the config file can…
Dumbris Nov 23, 2026
f9d1909
fix(config): base the upgrade warning on the fields the resolver expands
Dumbris Nov 23, 2026
2186531
fix(secret): capture deny-list file identities eagerly, from a handle…
Dumbris Nov 23, 2026
f10ae62
docs(config): state the limits of hardlink protection for upstream ${…
Dumbris Nov 23, 2026
8149936
style(secret): reflect.Pointer for govet inline
Dumbris Nov 23, 2026
dc111ce
fix(secret): capture the replaced config's identity with full sharing…
Dumbris Nov 23, 2026
74db1ae
fix(secret): give CreateFile the extended-length path for identity ca…
Dumbris Nov 23, 2026
458de66
Merge origin/main into feat/secret-file-dirs
Dumbris Nov 24, 2026
7ed8bd6
fix(secret): bind superseded config records to the file's mtime
Dumbris Nov 24, 2026
e6c5cfc
docs(secret): note what ends a superseded-config refusal
Dumbris Nov 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Releases follow [Semantic Versioning](https://semver.org/).

### Breaking Changes

- **config: `secret_file_dirs` allow-list for `${file:}` and upstream guards (#1721).** Upstream server fields resolve `${file:}` only under `secret_file_dirs` (platform defaults, `CREDENTIALS_DIRECTORY`, `<data-dir>/secrets`; `[]` disables; `["*"]` warns). Before this release any absolute path resolved, so an existing upstream `${file:/abs/path}` outside the allow-list stops resolving after the upgrade and that server fails to connect (on macOS and Windows the default list is only `<data-dir>/secrets`); startup logs one warning naming every affected server. Upstream fields also refuse `${env:MCPPROXY_*}`, refuse proxy config/data/admin-key files by open-handle identity, any file with more than one hard link, and earlier config versions replaced on save, and use traversal-resistant opens (`os.Root`). `MCPPROXY_API_KEY_FILE`, `oauth_token_encryption_key` / `MCPPROXY_OAUTH_TOKEN_ENCRYPTION_KEY_FILE` are not gated; `api_key` `${file:}` is. `secret_file_dirs` is config-file-only (management APIs cannot change it, and an undecodable config file refuses the edit). Policy denials stop one upstream without stopping the daemon. **Migration:** add the file's directory to `secret_file_dirs` in the config file (an explicit list replaces the platform defaults), or move the file under `<data-dir>/secrets`; a hardlinked secret file must be copied instead (more than one link is refused); `["*"]` restores the old any-path behaviour.

- **trust mode / tool approvals (Spec 119):** `scan` is now the default per-server trust mode, and under
`scan` a **changed** tool contract whose offline TPA scan is clean is approved automatically in the same
discovery pass (reason `scan_approved`, activity event `tool_auto_approved`) instead of being held. A
Expand Down
4 changes: 1 addition & 3 deletions cmd/mcpproxy/call_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/smart-mcp-proxy/mcpproxy-go/internal/cliclient"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/config"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/index"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/secret"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/server"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/truncate"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/upstream"
Expand Down Expand Up @@ -506,8 +505,7 @@ func runCallToolVariantStandalone(ctx context.Context, toolVariant string, args
}
defer indexManager.Close()

// Create secret resolver for command execution
secretResolver := secret.NewResolver()
secretResolver := cliUpstreamSecretResolver(globalConfig)

// Create upstream manager
upstreamManager := upstream.NewManager(logger, globalConfig, storageManager.GetBoltDB(), secretResolver, storageManager)
Expand Down
9 changes: 9 additions & 0 deletions cmd/mcpproxy/cli_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,17 @@ import (
"path/filepath"

"github.com/smart-mcp-proxy/mcpproxy-go/internal/config"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/secret"
)

// cliUpstreamSecretResolver matches the daemon's upstream ${file:}/env policy.
func cliUpstreamSecretResolver(cfg *config.Config) *secret.Resolver {
if cfg == nil {
return config.BuildSecretResolver(&config.Config{}, "", secret.ScopeUpstream)
}
return config.BuildSecretResolver(cfg, cfg.ConfigFilePathForPolicy(), secret.ScopeUpstream)
}

// cliDiagnosticsWriter receives the loader's removed-key / deprecated-key
// findings (Spec 107 FR-032) for every CLI command that loads the config
// through loadCLIConfig. It is stderr so structured stdout (`-o json`) stays
Expand Down
47 changes: 47 additions & 0 deletions cmd/mcpproxy/cli_upstream_secret_policy_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package main

import (
"context"
"os"
"path/filepath"
"testing"

"github.com/smart-mcp-proxy/mcpproxy-go/internal/config"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/secret"
"github.com/stretchr/testify/require"
)

func TestCLIUpstreamSecretResolver_RefusesOutOfPolicyFileAndMCPProxyEnv(t *testing.T) {
dir := t.TempDir()
allowed := filepath.Join(dir, "allowed")
outside := filepath.Join(dir, "outside")
require.NoError(t, os.MkdirAll(allowed, 0o700))
require.NoError(t, os.MkdirAll(outside, 0o700))
outsideFile := filepath.Join(outside, "secret")
require.NoError(t, os.WriteFile(outsideFile, []byte("leak\n"), 0o600))

w := config.SecretFileDirs{allowed}
cfg := &config.Config{DataDir: dir, Listen: "127.0.0.1:0", SecretFileDirs: &w}
path := filepath.Join(dir, config.ConfigFileName)
require.NoError(t, config.SaveConfig(cfg, path))
cfg, err := config.LoadFromFile(path)
require.NoError(t, err)

r := cliUpstreamSecretResolver(cfg)
srv := config.CopyServerConfig(&config.ServerConfig{
Name: "s",
URL: "http://127.0.0.1:9/mcp",
Headers: map[string]string{"Authorization": "Bearer ${file:" + outsideFile + "}"},
})
errs := r.ExpandStructSecretsCollectErrors(context.Background(), srv)
require.NotEmpty(t, errs)

srv2 := config.CopyServerConfig(&config.ServerConfig{
Name: "s",
URL: "http://127.0.0.1:9/mcp",
Env: map[string]string{"K": "${env:MCPPROXY_API_KEY}"},
})
errs2 := r.ExpandStructSecretsCollectErrors(context.Background(), srv2)
require.NotEmpty(t, errs2)
require.ErrorIs(t, errs2[0].Err, secret.ErrReservedEnvVar)
}
4 changes: 1 addition & 3 deletions cmd/mcpproxy/code_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/smart-mcp-proxy/mcpproxy-go/internal/codescripts"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/config"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/index"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/secret"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/server"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/storage"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/truncate"
Expand Down Expand Up @@ -323,8 +322,7 @@ func runCodeExecStandalone(globalConfig *config.Config, code string, input map[s
}
defer indexManager.Close()

// Create secret resolver
secretResolver := secret.NewResolver()
secretResolver := cliUpstreamSecretResolver(globalConfig)

// Create upstream manager
upstreamManager := upstream.NewManager(logger, globalConfig, storageManager.GetBoltDB(), secretResolver, storageManager)
Expand Down
61 changes: 61 additions & 0 deletions cmd/mcpproxy/doctor_upstream_secret_policy_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package main

import (
"os"
"path/filepath"
"strings"
"testing"

"github.com/smart-mcp-proxy/mcpproxy-go/internal/config"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/health"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/secret"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/upstream/core"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/zap"
)

func TestDoctorOutput_UpstreamSecretPolicyDenialPublicOnly(t *testing.T) {
dir := t.TempDir()
allowed := filepath.Join(dir, "allowed")
outside := filepath.Join(dir, "outside", "deep", "token.pem")
require.NoError(t, os.MkdirAll(allowed, 0o700))
require.NoError(t, os.MkdirAll(filepath.Dir(outside), 0o700))
require.NoError(t, os.WriteFile(outside, []byte("x\n"), 0o600))
w := config.SecretFileDirs{allowed}
cfg := &config.Config{DataDir: dir, SecretFileDirs: &w}
r := config.BuildSecretResolver(cfg, "", secret.ScopeUpstream)
srvCfg := &config.ServerConfig{
Name: "denied", Command: "true",
Env: map[string]string{"TOKEN": "${file:" + outside + "}"},
}
_, err := core.NewClientWithOptions("denied", srvCfg, zap.NewNop(), nil, cfg, nil, false, r)
require.Error(t, err)
var pe *core.UpstreamSecretPolicyError
require.ErrorAs(t, err, &pe)

h := health.CalculateHealth(health.HealthCalculatorInput{
Name: "denied", Enabled: true, State: "error", Connected: false, LastError: err.Error(),
}, nil)
diag := map[string]interface{}{
"total_issues": 1,
"upstream_errors": []interface{}{
map[string]interface{}{
"server_name": "denied",
"error_message": h.Detail,
},
},
}

oldFmt := doctorOutput
t.Cleanup(func() { doctorOutput = oldFmt })
doctorOutput = "pretty"
var runErr error
out, _ := captureStd(func() { runErr = outputDiagnostics(diag, nil, nil, "", nil) })
require.NoError(t, runErr)
assert.Contains(t, out, pe.Public)
for _, leak := range []string{outside, "${file:", "TOKEN"} {
assert.NotContains(t, out, leak)
}
assert.True(t, strings.Contains(out, "Upstream Server Connection Errors"))
}
12 changes: 6 additions & 6 deletions cmd/mcpproxy/secrets_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func getSecretsSetCommand() *cobra.Command {
// The arguments parsed; from here a failure is about the keyring,
// and the usage text would only bury the explanation.
cmd.SilenceUsage = true
return runSecretsSet(secret.NewResolver(), os.Stdin, os.Stdout, args, opts)
return runSecretsSet(config.BuildSecretResolverForKeyringCLI(), os.Stdin, os.Stdout, args, opts)
},
}

Expand Down Expand Up @@ -188,7 +188,7 @@ func getSecretsGetCommand() *cobra.Command {
RunE: func(_ *cobra.Command, args []string) error {
name := args[0]

resolver := secret.NewResolver()
resolver := config.BuildSecretResolverForKeyringCLI()
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()

Expand Down Expand Up @@ -230,7 +230,7 @@ func getSecretsDeleteCommand() *cobra.Command {
RunE: func(_ *cobra.Command, args []string) error {
name := args[0]

resolver := secret.NewResolver()
resolver := config.BuildSecretResolverForKeyringCLI()
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()

Expand Down Expand Up @@ -264,7 +264,7 @@ func getSecretsListCommand() *cobra.Command {
Short: "List all stored secrets",
Long: "List all secrets stored in available providers. Secret values are never displayed.",
RunE: func(_ *cobra.Command, _ []string) error {
resolver := secret.NewResolver()
resolver := config.BuildSecretResolverForKeyringCLI()
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()

Expand Down Expand Up @@ -369,8 +369,8 @@ func getSecretsMigrateCommand() *cobra.Command {
return fmt.Errorf("failed to load config: %w", err)
}

// Analyze configuration for potential secrets
resolver := secret.NewResolver()
// Analyze configuration for plaintext migration hints (no upstream file reads).
resolver := config.BuildSecretResolverForKeyringCLI()
analysis := resolver.AnalyzeForMigration(cfg)

if len(analysis.Candidates) == 0 {
Expand Down
4 changes: 1 addition & 3 deletions cmd/mcpproxy/tools_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/smart-mcp-proxy/mcpproxy-go/internal/contracts"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/logs"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/preflight"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/secret"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/security/detect"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/storage"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/transport"
Expand Down Expand Up @@ -1110,8 +1109,7 @@ func runToolsListStandalone(ctx context.Context, serverName string, globalConfig
}
}

// Create secret resolver
secretResolver := secret.NewResolver()
secretResolver := cliUpstreamSecretResolver(globalConfig)

// Create log config for managed client
logConfig := &config.LogConfig{
Expand Down
3 changes: 2 additions & 1 deletion cmd/mcpproxy/upstream_add_secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"strings"
"testing"

"github.com/smart-mcp-proxy/mcpproxy-go/internal/config"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/secret"
)

Expand Down Expand Up @@ -62,7 +63,7 @@ func (f *fakeKeyringProvider) List(_ context.Context) ([]secret.Ref, error) {
func (f *fakeKeyringProvider) IsAvailable() bool { return f.available }

func newTestSecretResolver(fake *fakeKeyringProvider) *secret.Resolver {
r := secret.NewResolver()
r := config.BuildSecretResolverForKeyringCLI()
r.RegisterProvider("keyring", fake)
return r
}
Expand Down
3 changes: 1 addition & 2 deletions cmd/mcpproxy/upstream_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"github.com/smart-mcp-proxy/mcpproxy-go/internal/logs"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/oauth"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/reqcontext"
"github.com/smart-mcp-proxy/mcpproxy-go/internal/secret"
)

var (
Expand Down Expand Up @@ -1580,7 +1579,7 @@ func runUpstreamAdd(cmd *cobra.Command, args []string) error {
// FR-065: --secret-env/--secret-header write to the OS keyring instead
// of the config, under the shared per-kind ref name, and merge
// ${keyring:<ref>} into the same env/headers maps above.
resolver := secret.NewResolver()
resolver := config.BuildSecretResolverForKeyringCLI()
var writtenSecretRefs []string
if len(upstreamAddSecretEnvs) > 0 || len(upstreamAddSecretHeaders) > 0 {
var err error
Expand Down
34 changes: 34 additions & 0 deletions docs/configuration/config-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ MCPProxy uses a JSON configuration file located at `~/.mcpproxy/mcp_config.json`
|--------|------|---------|-------------|
| `listen` | string | `127.0.0.1:8080` | Address and port to listen on |
| `data_dir` | string | `~/.mcpproxy` | Directory for data storage |
| `secret_file_dirs` | string[] | platform defaults | Where `${file:}` references may read on disk. See [Secret file directories](#secret-file-directories-secret_file_dirs). |
| `api_key` | string | auto-generated | API key for REST API authentication |
| `oauth_token_encryption_key` | string | `""` (off) | Key that encrypts the upstream OAuth tokens in `config.db` (AES-256-GCM): 32 random bytes, base64. A literal key or one reference: `${file:/abs/path}`, `${env:NAME}`, `${keyring:NAME}`. Env `MCPPROXY_OAUTH_TOKEN_ENCRYPTION_KEY` / `MCPPROXY_OAUTH_TOKEN_ENCRYPTION_KEY_FILE` override it. A key that cannot be resolved stops startup with exit code 4 before `config.db` is opened. Needs a restart. Masked in the REST API and the Web UI. See [OAuth Token Encryption](/features/oauth-token-encryption) |
| `trusted_hosts` | string[] | `[]` | Non-loopback `Host` header values accepted on a loopback listener. Needed when running behind a reverse proxy — see [Reverse Proxy Deployment](/operations/reverse-proxy). This is DNS-rebinding protection only; it is **not** the control for forwarded headers (see `trusted_proxies`) |
Expand All @@ -68,6 +69,39 @@ MCPProxy uses a JSON configuration file located at `~/.mcpproxy/mcp_config.json`
| `enable_socket` | boolean | `true` | Enable the Unix socket/named pipe the tray uses. Socket connections are trusted **without the API key**, including stdio servers spawned under `none` or `sandbox` isolation, which can then mint agent tokens. Set `false` on headless installs and whenever untrusted stdio servers run outside `docker` isolation. |
| `forward_client_headers` | boolean | `true` | Master switch for [client header forwarding](/configuration/upstream-servers#client-header-forwarding). Nothing is forwarded until a server lists names in `forward_headers`. Env `MCPPROXY_FORWARD_CLIENT_HEADERS=false` disables it for the process (never persisted). |

### Secret file directories (`secret_file_dirs`) {#secret-file-directories-secret_file_dirs}

`secret_file_dirs` is the allow-list of absolute directories from which `${file:/absolute/path}` references may read a secret. It applies to proxy-owned fields (`api_key`, a `${file:}` in `data_dir`, and similar) and to every field on an upstream server entry (see [Upstream servers — Secret references](/configuration/upstream-servers#secret-references)). Upstream `${file:}` reads still refuse proxy state files even when a path lies under an allowed root.

**Defaults when the key is omitted:**

| Platform | Roots |
|----------|--------|
| Linux | `/run/secrets`, `/run/credentials`, and `<data-dir>/secrets` once `data_dir` is resolved |
| macOS | `<data-dir>/secrets` |
| Windows | `<data-dir>\secrets` |

If `CREDENTIALS_DIRECTORY` is set to an absolute path (systemd user credentials, some container layouts), that directory is added to the effective list on every platform.

| Value | Meaning |
|-------|---------|
| *(omitted)* | Platform defaults in the table above |
| `[]` | Every `${file:}` reference is refused |
| `["*"]` | Compatibility mode: any absolute regular file may be read (upstream deny rules still apply). Emits a startup **warning** |
| `["/var/lib/secrets", ...]` | Only files contained in the listed absolute directories |

Validation rejects JSON `null`, relative paths, and a list that mixes `*` with other entries. A configured root that does not exist yet produces a startup warning; reads under that root fail until the directory appears.

**Upgrading (breaking change):** releases before #1721 resolved any absolute `${file:}` path in an upstream server entry. After the upgrade, a reference outside the effective allow-list stops resolving and that server fails to connect; with the key omitted, macOS and Windows allow only `<data-dir>/secrets`. Startup logs one warning naming every affected server (`upstream ${file:} references are outside secret_file_dirs and will not resolve`). **Migration:** add the file's directory to `secret_file_dirs` in this file (an explicit list replaces the platform defaults, so include `<data-dir>/secrets` if you use it), or move the file under `<data-dir>/secrets`. A secret file with more than one hard link is refused, so copy a hardlinked secret instead of linking it. `["*"]` restores the old behaviour for every path; the upstream deny rules still apply, but it does not protect against a concurrent filesystem writer swapping a symlink between the check and the open.

**OAuth token encryption key:** `oauth_token_encryption_key` and `MCPPROXY_OAUTH_TOKEN_ENCRYPTION_KEY_FILE` are proxy-owned operator keys, like `MCPPROXY_API_KEY_FILE`, and are **not** gated by `secret_file_dirs`: the recommended key location is outside `data_dir` (see [OAuth Token Encryption](/features/oauth-token-encryption)), and the key is never shown or sent anywhere, so an unreadable or wrong file only stops startup with exit code 4.

**Operator policy, not management API (v1):** `secret_file_dirs` cannot be changed or widened through `PATCH /api/v1/config`, `POST /api/v1/config/apply`, or any management merge that would persist a different value than the on-disk file — each save restores the file’s setting (`PersistableConfig`). Hot reload: editing the key in `mcp_config.json` rebuilds the upstream secret resolver without a process restart. For v1, anyone who can replace the entire config file is trusted to set policy directly in that file.

**Admin API key and `MCPPROXY_API_KEY_FILE`:** The environment variable `MCPPROXY_API_KEY_FILE` is operator-controlled and is **not** gated by `secret_file_dirs` (it uses the same absolute-path read rules as other admin key files). It is refused when it resolves to the active config file or to anything under `data_dir` except `<data-dir>/secrets`. A `${file:}` in the `api_key` field **is** gated by `secret_file_dirs`. Setting both `MCPPROXY_API_KEY` and `MCPPROXY_API_KEY_FILE` to non-empty values still fails startup; an unusable key file still fails startup with no generated-key fallback.

See [Environment variables — API key from a file](/configuration/environment-variables#api-key-from-a-file) for `MCPPROXY_API_KEY_FILE` examples.

### `audit_log` (edition-neutral JSONL audit record)

One JSONL line per authorization decision and tool call. Personal edition defaults to
Expand Down
Loading
Loading