Skip to content

path normalization auth bypass - #5763

Merged
akshaydeo merged 1 commit into
devfrom
block-unauthenticated-native-plugin-loading
Aug 3, 2026
Merged

path normalization auth bypass#5763
akshaydeo merged 1 commit into
devfrom
block-unauthenticated-native-plugin-loading

Conversation

@akshaydeo

@akshaydeo akshaydeo commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Loading a custom plugin path causes native code (a .so) to be dlopen()'d directly into the gateway process. Previously, this was allowed even when dashboard authentication was disabled or unconfigured — meaning any caller who could reach the management API could inject arbitrary native code. This PR closes that gap by requiring a genuinely authenticated admin session for any create or update operation that sets a non-builtin plugin path, and separately hardens the plugin downloader against SSRF.

Changes

  • Added BifrostContextKeyAuthBypassed context key, set by the auth middleware exclusively when a request is let through because dashboard auth is disabled/unconfigured (distinct from IsLocalAdminContextKey, which is also set on real authenticated sessions).
  • createPlugin and updatePlugin handlers now check BifrostContextKeyAuthBypassed and return 403 before any DB write when a non-builtin path is supplied without genuine authentication.
  • Replaced the fasthttp-based plugin downloader with a net/http client backed by network.SSRFSafeDialContext, matching the SSRF hardening already applied to core/providers/utils.FetchAndEncodeURL. The new client: rejects non-http/https schemes before any network call, refuses connections to loopback, private, CGNAT, link-local, and unspecified addresses (including IPv4-in-IPv6 transition addresses) at dial time (not just DNS lookup time, so DNS rebinding doesn't bypass it), applies the same IP check to redirect targets, caps redirect depth at 5, and limits response body reads to 200 MB.
  • Tests for DownloadPlugin now use a useNonSSRFGuardedClient helper that swaps in a plain dialer for the duration of each test (since httptest servers bind to loopback, which the production dialer correctly blocks). A new TestDownloadPlugin_BlocksSSRFToLoopback test verifies the production guard is active by default, and TestDownloadPlugin_RejectsNonHTTPScheme verifies file:// and similar schemes are rejected before any network call.
  • New handler tests cover all four cases: create with bypassed auth (expect 403, no DB write), create with real auth (expect 201, path stored), update with bypassed auth (expect 403, no DB write), and the existing config-merge behaviour.
  • OpenAPI docs and the plugin sequencing guide updated to document the 403 response and the authentication requirement for path.
  • Dependency bumps: aws-sdk-go-v2/config → v1.32.14, aws-sdk-go-v2/service/s3 → v1.99.0, aws-sdk-go-v2/internal/ini → v1.8.6, buger/jsonparser → v1.2.0.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

This is primarily a security hardening change.

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

# Run all tests
go test ./...

# Specifically verify the new plugin handler guards
go test ./transports/bifrost-http/handlers/... -run TestCreatePlugin_RejectsCustomPathWhenAuthBypassed
go test ./transports/bifrost-http/handlers/... -run TestCreatePlugin_AllowsCustomPathWhenNotBypassed
go test ./transports/bifrost-http/handlers/... -run TestUpdatePlugin_RejectsCustomPathWhenAuthBypassed

# Verify SSRF guard on plugin downloader
go test ./framework/plugins/... -run TestDownloadPlugin_BlocksSSRFToLoopback
go test ./framework/plugins/... -run TestDownloadPlugin_RejectsNonHTTPScheme

To manually verify the 403 behaviour: start the gateway with no dashboard auth configured, then attempt POST /api/plugins with a path field pointing to a .so. The response should be 403 with a message instructing the operator to enable dashboard authentication first.

Breaking changes

  • Yes
  • No

Operators running with dashboard authentication disabled who were previously able to create or update custom plugin paths via the API will now receive a 403. To restore the capability, enable dashboard authentication and authenticate before calling those endpoints.

Security considerations

  • Closes an unauthenticated native code injection vector: without this change, any network-reachable caller could dlopen() an attacker-controlled .so into the gateway process when dashboard auth was off.
  • The SSRF fix on the plugin downloader prevents a crafted plugin URL from causing the gateway to fetch from internal/metadata endpoints (e.g. cloud IMDS). The guard runs at dial time, not DNS resolution time, so DNS rebinding attacks do not bypass it.
  • BifrostContextKeyAuthBypassed is intentionally separate from IsLocalAdminContextKey so that future handlers gating other high-risk operations can use the same signal without ambiguity.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bfc76f76-d098-446e-af57-7e0e78de832e

📥 Commits

Reviewing files that changed from the base of the PR and between 8c2b96f and 40bbebc.

⛔ Files ignored due to path filters (4)
  • core/go.sum is excluded by !**/*.sum
  • plugins/jsonparser/go.sum is excluded by !**/*.sum
  • plugins/mocker/go.sum is excluded by !**/*.sum
  • plugins/prompts/go.sum is excluded by !**/*.sum
📒 Files selected for processing (26)
  • core/go.mod
  • core/network/ssrf.go
  • core/network/ssrf_test.go
  • core/schemas/bifrost.go
  • docs/docs.json
  • docs/enterprise/migration-guides/v2.0.0.mdx
  • docs/migration-guides/v2.0.0.mdx
  • docs/openapi/openapi.json
  • docs/openapi/paths/management/plugins.yaml
  • docs/plugins/sequencing.mdx
  • framework/changelog.md
  • framework/plugins/soloader.go
  • framework/plugins/soplugin_test.go
  • framework/plugins/utils.go
  • framework/plugins/utils_test.go
  • plugins/jsonparser/go.mod
  • plugins/mocker/go.mod
  • plugins/prompts/go.mod
  • transports/bifrost-http/handlers/middlewares.go
  • transports/bifrost-http/handlers/plugins.go
  • transports/bifrost-http/handlers/plugins_test.go
  • transports/bifrost-http/lib/config.go
  • transports/bifrost-http/server/server.go
  • transports/changelog.md
  • transports/config.schema.json
  • transports/version
🚧 Files skipped from review as they are similar to previous changes (26)
  • docs/plugins/sequencing.mdx
  • transports/bifrost-http/handlers/middlewares.go
  • framework/changelog.md
  • plugins/mocker/go.mod
  • plugins/prompts/go.mod
  • plugins/jsonparser/go.mod
  • transports/bifrost-http/server/server.go
  • transports/changelog.md
  • framework/plugins/soloader.go
  • transports/bifrost-http/handlers/plugins.go
  • docs/openapi/openapi.json
  • docs/docs.json
  • transports/bifrost-http/lib/config.go
  • docs/enterprise/migration-guides/v2.0.0.mdx
  • core/go.mod
  • framework/plugins/utils.go
  • framework/plugins/soplugin_test.go
  • docs/migration-guides/v2.0.0.mdx
  • transports/bifrost-http/handlers/plugins_test.go
  • transports/config.schema.json
  • framework/plugins/utils_test.go
  • docs/openapi/paths/management/plugins.yaml
  • core/network/ssrf_test.go
  • core/network/ssrf.go
  • core/schemas/bifrost.go
  • transports/version

📝 Walkthrough

Summary by CodeRabbit

  • Security

    • Restricted custom plugin paths to authenticated administrator sessions.
    • Blocked private and loopback download destinations by default.
    • Added secure HTTP(S) handling, redirect limits, timeouts, and response-size limits.
    • Added optional allowlisting for trusted private plugin hosts with startup validation.
  • Bug Fixes

    • Prevented unauthorized plugin creation or updates before data is saved.
    • Added clear 403 responses when requirements are unmet.
  • Documentation

    • Updated API documentation, examples, and migration guidance with authentication and network security requirements.

Walkthrough

The PR adds SSRF-safe remote plugin downloads with validated private-network allowlisting. It requires genuine admin authentication for custom native plugin paths, wires deploy-time configuration, updates documentation, and refreshes dependencies.

Changes

Plugin security controls

Layer / File(s) Summary
Custom plugin path authorization
core/schemas/bifrost.go, transports/bifrost-http/handlers/..., docs/openapi/..., docs/plugins/sequencing.mdx
Authentication bypasses receive a distinct context marker. Custom native plugin paths return 403 before persistence. API documentation and examples describe the authentication and public-address requirements.
SSRF allowlist and secure downloader
core/network/ssrf.go, framework/plugins/...
SSRF dialing supports validated private-network exceptions. Plugin downloads use bounded net/http clients, restricted schemes and redirects, response limits, and per-request address validation.
Loader configuration and release wiring
transports/bifrost-http/lib/config.go, transports/bifrost-http/server/server.go, transports/config.schema.json, docs/migration-guides/v2.0.0.mdx, docs/enterprise/migration-guides/v2.0.0.mdx, framework/changelog.md, transports/changelog.md, transports/version
Server configuration exposes and validates the private-download allowlist. The configured allowlist reaches shared-object loading. Migration guides, changelogs, navigation, and version metadata describe the changes.

Dependency version updates

Layer / File(s) Summary
Go module dependency updates
core/go.mod, plugins/*/go.mod
AWS SDK modules and github.com/buger/jsonparser now use newer versions where declared.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant AuthMiddleware
  participant PluginHandler
  participant SharedObjectPluginLoader
  participant DownloadPlugin
  participant SSRFSafeDialContextWithAllowlist
  Client->>AuthMiddleware: Submit plugin request
  AuthMiddleware->>PluginHandler: Provide authentication context
  PluginHandler->>SharedObjectPluginLoader: Load authorized custom plugin
  SharedObjectPluginLoader->>DownloadPlugin: Download remote plugin
  DownloadPlugin->>SSRFSafeDialContextWithAllowlist: Validate scheme, redirect, and destination
  SSRFSafeDialContextWithAllowlist-->>DownloadPlugin: Permit public or allowlisted address
  DownloadPlugin-->>SharedObjectPluginLoader: Return downloaded plugin
Loading

Possibly related PRs

Suggested reviewers: danpiths, pratham-mishra04, roroghost17

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 48.84% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title identifies the authentication-bypass aspect of the security change, but it does not mention the SSRF hardening.
Description check ✅ Passed The description covers the required sections, security impact, tests, breaking changes, documentation, and affected areas.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch block-unauthenticated-native-plugin-loading

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


Comment @coderabbitai help to get the list of available commands.

@akshaydeo
akshaydeo marked this pull request as ready for review August 2, 2026 04:33

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
docs/openapi/paths/management/plugins.yaml (1)

80-83: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Document the BifrostError body for both new 403 responses.

SendError returns a BifrostError. Add the application/json schema reference to both responses.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/openapi/paths/management/plugins.yaml` around lines 80 - 83, Update both
newly added 403 responses in the OpenAPI paths to document an application/json
response body using the existing BifrostError schema reference, while preserving
their current descriptions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@docs/openapi/paths/management/plugins.yaml`:
- Around line 80-83: Update both newly added 403 responses in the OpenAPI paths
to document an application/json response body using the existing BifrostError
schema reference, while preserving their current descriptions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: da9b0481-6379-4bec-ba02-88e3bbb4505d

📥 Commits

Reviewing files that changed from the base of the PR and between e493a6a and 58a345e.

⛔ Files ignored due to path filters (4)
  • core/go.sum is excluded by !**/*.sum
  • plugins/jsonparser/go.sum is excluded by !**/*.sum
  • plugins/mocker/go.sum is excluded by !**/*.sum
  • plugins/prompts/go.sum is excluded by !**/*.sum
📒 Files selected for processing (12)
  • core/go.mod
  • core/schemas/bifrost.go
  • docs/openapi/paths/management/plugins.yaml
  • docs/plugins/sequencing.mdx
  • framework/plugins/utils.go
  • framework/plugins/utils_test.go
  • plugins/jsonparser/go.mod
  • plugins/mocker/go.mod
  • plugins/prompts/go.mod
  • transports/bifrost-http/handlers/middlewares.go
  • transports/bifrost-http/handlers/plugins.go
  • transports/bifrost-http/handlers/plugins_test.go

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 2, 2026
Comment thread framework/plugins/utils.go Fixed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
transports/bifrost-http/server/server.go (1)

1022-1037: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Require the setup token until a real admin account exists.

The handler validates the setup token only when authConfig == nil. A disabled config with empty credentials can be persisted by loadAuthConfig, while CheckBootstrapToken treats any non-nil config as an existing admin. Since disabled auth bypasses middleware, an unauthenticated caller can create the first admin without the setup token. Base the gate and ClearBootstrapToken on non-empty admin credentials.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@transports/bifrost-http/server/server.go` around lines 1022 - 1037, The
setup-token gate must remain active until non-empty admin credentials exist, not
merely when auth configuration is non-nil. Update the handler’s auth-config
check and ClearBootstrapToken flow, together with
AuthMiddleware.CheckBootstrapToken if needed, so disabled configurations with
empty credentials still require the bootstrap token and only a real first admin
permanently clears it.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/network/ssrf.go`:
- Around line 171-197: Update NewAllowlist to detect dot-separated entries whose
components are all numeric after ParsePrefix and ParseAddr fail, and return the
existing invalid-entry error instead of passing them to isValidHostnameLiteral.
Preserve normal hostname handling for entries containing alphabetic labels or
non-IP-shaped syntax.

In `@docs/openapi/openapi.json`:
- Line 41706: Update the plugin creation description at
docs/openapi/openapi.json:41706-41706 to state that remote http/https paths must
resolve to public destinations by default, with private destinations allowed
through configured plugin_download_private_allowlist entries. Update the plugin
update description at docs/openapi/openapi.json:41897-41897 to document the same
scheme, destination, and allowlist policy.

---

Outside diff comments:
In `@transports/bifrost-http/server/server.go`:
- Around line 1022-1037: The setup-token gate must remain active until non-empty
admin credentials exist, not merely when auth configuration is non-nil. Update
the handler’s auth-config check and ClearBootstrapToken flow, together with
AuthMiddleware.CheckBootstrapToken if needed, so disabled configurations with
empty credentials still require the bootstrap token and only a real first admin
permanently clears it.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 974ff6ce-f0f0-4478-9f1a-b5e28e0ba0b4

📥 Commits

Reviewing files that changed from the base of the PR and between 58a345e and e7bb308.

⛔ Files ignored due to path filters (4)
  • core/go.sum is excluded by !**/*.sum
  • plugins/jsonparser/go.sum is excluded by !**/*.sum
  • plugins/mocker/go.sum is excluded by !**/*.sum
  • plugins/prompts/go.sum is excluded by !**/*.sum
📒 Files selected for processing (25)
  • core/go.mod
  • core/network/ssrf.go
  • core/network/ssrf_test.go
  • core/schemas/bifrost.go
  • docs/docs.json
  • docs/migration-guides/v2.0.0.mdx
  • docs/openapi/openapi.json
  • docs/openapi/paths/management/plugins.yaml
  • docs/plugins/sequencing.mdx
  • framework/changelog.md
  • framework/plugins/soloader.go
  • framework/plugins/soplugin_test.go
  • framework/plugins/utils.go
  • framework/plugins/utils_test.go
  • plugins/jsonparser/go.mod
  • plugins/mocker/go.mod
  • plugins/prompts/go.mod
  • transports/bifrost-http/handlers/middlewares.go
  • transports/bifrost-http/handlers/plugins.go
  • transports/bifrost-http/handlers/plugins_test.go
  • transports/bifrost-http/lib/config.go
  • transports/bifrost-http/server/server.go
  • transports/changelog.md
  • transports/config.schema.json
  • transports/version
🚧 Files skipped from review as they are similar to previous changes (10)
  • plugins/mocker/go.mod
  • core/schemas/bifrost.go
  • plugins/jsonparser/go.mod
  • plugins/prompts/go.mod
  • transports/bifrost-http/handlers/plugins.go
  • docs/plugins/sequencing.mdx
  • transports/bifrost-http/handlers/middlewares.go
  • transports/bifrost-http/handlers/plugins_test.go
  • docs/openapi/paths/management/plugins.yaml
  • core/go.mod

Comment thread core/network/ssrf.go
Comment thread docs/openapi/openapi.json Outdated
@akshaydeo
akshaydeo force-pushed the block-unauthenticated-native-plugin-loading branch from e7bb308 to 38b1108 Compare August 3, 2026 04:16

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/migration-guides/v2.0.0.mdx`:
- Around line 28-42: Update the migration guide’s Before/After configuration
examples so both include the same representative private-network plugin path
that triggers DownloadPlugin and SSRF protection; keep
plugin_download_private_allowlist absent in Before and populated in After,
making the allowlist the only relevant difference. Verify the examples remain
consistent with config.schema.json and provider behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4b7823e0-1a2f-4943-bb9c-ce4de7a0265f

📥 Commits

Reviewing files that changed from the base of the PR and between e7bb308 and 38b1108.

⛔ Files ignored due to path filters (4)
  • core/go.sum is excluded by !**/*.sum
  • plugins/jsonparser/go.sum is excluded by !**/*.sum
  • plugins/mocker/go.sum is excluded by !**/*.sum
  • plugins/prompts/go.sum is excluded by !**/*.sum
📒 Files selected for processing (26)
  • core/go.mod
  • core/network/ssrf.go
  • core/network/ssrf_test.go
  • core/schemas/bifrost.go
  • docs/docs.json
  • docs/enterprise/migration-guides/v2.0.0.mdx
  • docs/migration-guides/v2.0.0.mdx
  • docs/openapi/openapi.json
  • docs/openapi/paths/management/plugins.yaml
  • docs/plugins/sequencing.mdx
  • framework/changelog.md
  • framework/plugins/soloader.go
  • framework/plugins/soplugin_test.go
  • framework/plugins/utils.go
  • framework/plugins/utils_test.go
  • plugins/jsonparser/go.mod
  • plugins/mocker/go.mod
  • plugins/prompts/go.mod
  • transports/bifrost-http/handlers/middlewares.go
  • transports/bifrost-http/handlers/plugins.go
  • transports/bifrost-http/handlers/plugins_test.go
  • transports/bifrost-http/lib/config.go
  • transports/bifrost-http/server/server.go
  • transports/changelog.md
  • transports/config.schema.json
  • transports/version
🚧 Files skipped from review as they are similar to previous changes (24)
  • transports/bifrost-http/handlers/middlewares.go
  • transports/version
  • transports/changelog.md
  • plugins/mocker/go.mod
  • plugins/prompts/go.mod
  • framework/changelog.md
  • core/schemas/bifrost.go
  • docs/plugins/sequencing.mdx
  • transports/bifrost-http/handlers/plugins.go
  • core/go.mod
  • docs/openapi/paths/management/plugins.yaml
  • docs/docs.json
  • transports/bifrost-http/server/server.go
  • plugins/jsonparser/go.mod
  • transports/bifrost-http/handlers/plugins_test.go
  • framework/plugins/utils_test.go
  • docs/openapi/openapi.json
  • transports/config.schema.json
  • framework/plugins/soplugin_test.go
  • framework/plugins/utils.go
  • framework/plugins/soloader.go
  • transports/bifrost-http/lib/config.go
  • core/network/ssrf_test.go
  • core/network/ssrf.go

Comment thread docs/migration-guides/v2.0.0.mdx Outdated
@akshaydeo
akshaydeo force-pushed the block-unauthenticated-native-plugin-loading branch from 38b1108 to 8c2b96f Compare August 3, 2026 04:40
@akshaydeo
akshaydeo force-pushed the block-unauthenticated-native-plugin-loading branch from 8c2b96f to 40bbebc Compare August 3, 2026 04:47
@coderabbitai
coderabbitai Bot requested a review from danpiths August 3, 2026 04:49

akshaydeo commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Aug 3, 4:50 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Aug 3, 4:50 AM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo
akshaydeo merged commit e0057ff into dev Aug 3, 2026
15 checks passed
@akshaydeo
akshaydeo deleted the block-unauthenticated-native-plugin-loading branch August 3, 2026 04:50
akshaydeo added a commit that referenced this pull request Aug 5, 2026
Loading a custom plugin `path` causes native code (a `.so`) to be `dlopen()`'d directly into the gateway process. Previously, this was allowed even when dashboard authentication was disabled or unconfigured — meaning any caller who could reach the management API could inject arbitrary native code. This PR closes that gap by requiring a genuinely authenticated admin session for any create or update operation that sets a non-builtin plugin `path`, and separately hardens the plugin downloader against SSRF.

- Added `BifrostContextKeyAuthBypassed` context key, set by the auth middleware exclusively when a request is let through because dashboard auth is disabled/unconfigured (distinct from `IsLocalAdminContextKey`, which is also set on real authenticated sessions).
- `createPlugin` and `updatePlugin` handlers now check `BifrostContextKeyAuthBypassed` and return `403` before any DB write when a non-builtin `path` is supplied without genuine authentication.
- Replaced the `fasthttp`-based plugin downloader with a `net/http` client backed by `network.SSRFSafeDialContext`, matching the SSRF hardening already applied to `core/providers/utils.FetchAndEncodeURL`. The new client: rejects non-`http`/`https` schemes before any network call, refuses connections to loopback, private, CGNAT, link-local, and unspecified addresses (including IPv4-in-IPv6 transition addresses) at dial time (not just DNS lookup time, so DNS rebinding doesn't bypass it), applies the same IP check to redirect targets, caps redirect depth at 5, and limits response body reads to 200 MB.
- Tests for `DownloadPlugin` now use a `useNonSSRFGuardedClient` helper that swaps in a plain dialer for the duration of each test (since `httptest` servers bind to loopback, which the production dialer correctly blocks). A new `TestDownloadPlugin_BlocksSSRFToLoopback` test verifies the production guard is active by default, and `TestDownloadPlugin_RejectsNonHTTPScheme` verifies `file://` and similar schemes are rejected before any network call.
- New handler tests cover all four cases: create with bypassed auth (expect 403, no DB write), create with real auth (expect 201, path stored), update with bypassed auth (expect 403, no DB write), and the existing config-merge behaviour.
- OpenAPI docs and the plugin sequencing guide updated to document the 403 response and the authentication requirement for `path`.
- Dependency bumps: `aws-sdk-go-v2/config` → v1.32.14, `aws-sdk-go-v2/service/s3` → v1.99.0, `aws-sdk-go-v2/internal/ini` → v1.8.6, `buger/jsonparser` → v1.2.0.

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [x] Chore/CI

> This is primarily a security hardening change.

- [x] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [x] Plugins
- [ ] UI (React)
- [x] Docs

```sh
go test ./...

go test ./transports/bifrost-http/handlers/... -run TestCreatePlugin_RejectsCustomPathWhenAuthBypassed
go test ./transports/bifrost-http/handlers/... -run TestCreatePlugin_AllowsCustomPathWhenNotBypassed
go test ./transports/bifrost-http/handlers/... -run TestUpdatePlugin_RejectsCustomPathWhenAuthBypassed

go test ./framework/plugins/... -run TestDownloadPlugin_BlocksSSRFToLoopback
go test ./framework/plugins/... -run TestDownloadPlugin_RejectsNonHTTPScheme
```

To manually verify the 403 behaviour: start the gateway with no dashboard auth configured, then attempt `POST /api/plugins` with a `path` field pointing to a `.so`. The response should be `403` with a message instructing the operator to enable dashboard authentication first.

- [x] Yes
- [ ] No

Operators running with dashboard authentication disabled who were previously able to create or update custom plugin paths via the API will now receive a `403`. To restore the capability, enable dashboard authentication and authenticate before calling those endpoints.

- Closes an unauthenticated native code injection vector: without this change, any network-reachable caller could `dlopen()` an attacker-controlled `.so` into the gateway process when dashboard auth was off.
- The SSRF fix on the plugin downloader prevents a crafted plugin URL from causing the gateway to fetch from internal/metadata endpoints (e.g. cloud IMDS). The guard runs at dial time, not DNS resolution time, so DNS rebinding attacks do not bypass it.
- `BifrostContextKeyAuthBypassed` is intentionally separate from `IsLocalAdminContextKey` so that future handlers gating other high-risk operations can use the same signal without ambiguity.

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable
@akshaydeo akshaydeo mentioned this pull request Aug 5, 2026
18 tasks
akshaydeo added a commit that referenced this pull request Aug 5, 2026
## Summary

Resolves merge conflicts in `core/go.sum` that were left over from merging the path normalization auth bypass fix (#5763).

## Changes

- Removed leftover `<<<<<<< HEAD`, `=======`, and `>>>>>>> e0057ff` conflict markers from `core/go.sum`
- Retained the correct `go.mod` hash lines for `aws-sdk-go-v2/config`, `aws-sdk-go-v2/internal/ini`, and `aws-sdk-go-v2/service/s3` that were dropped during the conflict

## Type of change

- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [x] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

```sh
cd core
go mod verify
go test ./...
```

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

Closes #5763

## Security considerations

No security implications. This is a cleanup of unresolved merge conflict markers in the dependency lockfile.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
akshaydeo added a commit that referenced this pull request Aug 6, 2026
* feat: support matview_refresh_interval "off" to disable logstore matview maintenance (#5693)

* feat: support matview_refresh_interval "off" to disable logstore matview maintenance

The materialized views back only the dashboard UI. Deployments that run
Bifrost headless behind their own observability stack pay the REFRESH
MATERIALIZED VIEW CONCURRENTLY cost for views nothing reads, and the 5s
floor means the interval alone cannot turn maintenance off.

With "off" (or a non-positive duration) the logs store skips view
creation, the initial refresh, and the periodic refresher entirely.
matViewsReady stays false, so dashboard queries fall back to the raw
tables, and the runtime self-heal path cannot re-arm maintenance since
it only triggers from matview-path queries.

* fix: guard matview self-heal when maintenance is disabled

Review follow-up: carry the resolved disabled state onto the store so
triggerMatViewSelfHeal cannot recreate views the configuration says must
not exist, and make the schema/docs explicit that a zero duration also
disables (positive sub-5s values still clamp up).

* V2.0.0 (#4365)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **Bug Fixes**
  * Improved token parameter compatibility handling to preserve alternative formats when the primary option is unsupported.

* **Chores**
  * Version updated to 2.0.0.
  * Enhanced load testing configuration for more reliable builds.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

* gomod fixes (#5731)

## Summary

Briefly explain the purpose of this PR and the problem it solves.

## Changes

- What was changed and why
- Any notable design decisions or trade-offs

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

Describe the steps to validate this change. Include commands and expected outcomes.

```sh
# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

If adding new configs or environment variables, document them here.

## Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

## Breaking changes

- [ ] Yes
- [ ] No

If yes, describe impact and migration instructions.

## Related issues

Link related issues and discussions. Example: Closes #123

## Security considerations

Note any security implications (auth, secrets, PII, sandboxing, etc.).

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* third party notice (#5735)

## Summary

Adds a `THIRD_PARTY_NOTICES.md` file to formally document third-party components used in Bifrost that carry license terms requiring explicit attribution — specifically MPL-2.0 licensed dependencies and embedded source code derived from external projects.

## Changes

- Introduces `THIRD_PARTY_NOTICES.md` to attribute:
  - Embedded source code in `framework/migrator/migrator.go` derived from `go-gormigrate/gormigrate` (MIT)
  - Go binary dependencies carrying MPL-2.0 terms: `github.com/cyphar/filepath-securejoin` and `github.com/hashicorp/go-version`
  - npm build-time devDependencies carrying MPL-2.0 terms: `lightningcss` (never shipped to end users) and `dompurify` (Apache-2.0 option elected)
- All MPL-2.0 components are used unmodified and combined as a "Larger Work" per MPL-2.0 Section 3.3; no Bifrost source files are themselves MPL-licensed.

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [x] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [x] Docs

## How to test

No functional changes — review the file contents to confirm accuracy of license attributions against the listed upstream repositories.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

N/A

## Security considerations

This change has no security implications. It is a legal/compliance attribution document only.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* feat(mcp-guardrails): add MCP log redaction changes (#5744)

## Summary

Briefly explain the purpose of this PR and the problem it solves.

## Changes

- What was changed and why
- Any notable design decisions or trade-offs

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

Describe the steps to validate this change. Include commands and expected outcomes.

```sh
# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

If adding new configs or environment variables, document them here.

## Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

## Breaking changes

- [ ] Yes
- [ ] No

If yes, describe impact and migration instructions.

## Related issues

Link related issues and discussions. Example: Closes #123

## Security considerations

Note any security implications (auth, secrets, PII, sandboxing, etc.).

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* feat(mcp-guardrails): ui changes (#5745)

## Summary

Briefly explain the purpose of this PR and the problem it solves.

## Changes

- What was changed and why
- Any notable design decisions or trade-offs

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

Describe the steps to validate this change. Include commands and expected outcomes.

```sh
# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

If adding new configs or environment variables, document them here.

## Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

## Breaking changes

- [ ] Yes
- [ ] No

If yes, describe impact and migration instructions.

## Related issues

Link related issues and discussions. Example: Closes #123

## Security considerations

Note any security implications (auth, secrets, PII, sandboxing, etc.).

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* added plugin logs in mcp logs (#5746)

## Summary

Briefly explain the purpose of this PR and the problem it solves.

## Changes

- What was changed and why
- Any notable design decisions or trade-offs

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

Describe the steps to validate this change. Include commands and expected outcomes.

```sh
# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

If adding new configs or environment variables, document them here.

## Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

## Breaking changes

- [ ] Yes
- [ ] No

If yes, describe impact and migration instructions.

## Related issues

Link related issues and discussions. Example: Closes #123

## Security considerations

Note any security implications (auth, secrets, PII, sandboxing, etc.).

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* dependabot alert fixes (#5756)

## Summary

Bumps several Go dependencies to their latest patch/minor versions across all modules in the repository.

## Changes

- `github.com/aws/aws-sdk-go-v2/service/s3`: `v1.97.3` → `v1.99.0`
- `github.com/aws/aws-sdk-go-v2/config`: `v1.32.11` → `v1.32.14`
- `github.com/aws/aws-sdk-go-v2/internal/ini`: `v1.8.5` → `v1.8.6`
- `github.com/weaviate/weaviate`: `v1.36.5` → `v1.38.0`
- `github.com/buger/jsonparser`: `v1.1.2` → `v1.2.0`
- `github.com/go-openapi/spec`: `v0.22.2` → `v0.22.3`
- `github.com/google/cel-go`: `v0.28.1` → `v0.29.0`
- `github.com/stretchr/objx`: `v0.5.3` added as an indirect dependency

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [x] Chore/CI

## Affected areas

- [x] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [x] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

```sh
go test ./...
```

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

None. All changes are dependency version bumps with no security-sensitive modifications.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* mcp guardrails : config,helm and docs changes (#5758)

* adds first time setup token to avoid opening new setup to the world (#5759)

## Summary

Closes a race-condition security gap where an unauthenticated network caller could reach a freshly deployed, not-yet-configured Bifrost instance and create the first admin account before the real operator does. Previously, `PUT /api/config` was intentionally open when no admin account existed (zero-config UX), but this left a window of exposure on any publicly reachable host.

The fix introduces a one-time **setup token** — generated in-memory at startup when no admin account is configured, printed to the server's startup logs, and required alongside the username/password when creating the first admin account. The token is never persisted, is regenerated on every restart until an admin account exists, and is permanently invalidated once the first admin account is created.

## Changes

- **Bootstrap token generation (`middlewares.go`):** `InitAuthMiddleware` generates a UUID setup token via `atomic.Pointer[string]` when no admin account is configured, logs it prominently to stdout, and exposes `CheckBootstrapToken` (constant-time comparison) and `ClearBootstrapToken` methods.
- **Token validation in the config handler (`config.go`):** `updateConfig` now calls `ValidateSetupToken` before allowing the first admin account to be created. Returns HTTP 403 if the token is missing or wrong.
- **Token cleared on first admin account creation (`server.go`):** `UpdateAuthConfig` calls `ClearBootstrapToken` after successfully persisting the first admin account, permanently closing the gate.
- **`setup_token`** **field added to** **`UpdateConfigRequest`:** The field is accepted in the request body but never persisted or returned by `GET /api/config`.
- **UI (`securityView.tsx`):** When no `auth_config` exists server-side (`isFirstTimeSetup`), a **Setup token** input field is shown below the password field. The token is validated client-side before submission and cleared from state after a successful save.
- **TypeScript types (`config.ts`):** `setup_token?: string` added to `BifrostConfig`.
- **OpenAPI schema (`config.yaml`):** `setup_token` documented on `UpdateConfigRequest`.
- **Docs:** A `<Warning>` block added to `security-best-practices.mdx` and a `<Note>` added to `setting-up-auth.mdx` explaining the setup token flow, where to find it, and that it only applies once.
- **Tests (`middlewares_test.go`):** Two new test cases cover the no-token-generated (pass-through) case and the validate-then-clear lifecycle.

## Type of change

- [ ] Bug fix
- [x] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [x] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [x] UI (React)
- [x] Docs

## How to test

**Manual flow:**

1. Start a fresh Bifrost instance with no existing admin account.
2. Check startup logs for the block beginning `No admin account is configured for this Bifrost instance yet.` and copy the setup token.
3. Open the dashboard → Security Settings. Confirm the **Setup token** field appears below the password field.
4. Attempt to save with auth enabled but without the setup token — expect a toast error.
5. Paste the correct token and save — expect success and the Setup token field to disappear on reload.
6. Confirm that `PUT /api/config` without the token returns HTTP 403 while no admin account exists.
7. Restart the server before completing setup and confirm a new token is printed.

```sh
# Core/Transports
go test ./transports/bifrost-http/handlers/...

# UI
cd ui
pnpm i
pnpm build
```

## Breaking changes

- [x] Yes
- [ ] No

Any automation or scripts that call `PUT /api/config` to create the first admin account on a fresh instance must now include `setup_token` in the request body. The token is available in the server's startup logs. Instances that already have an admin account configured are unaffected — the field is ignored once an admin account exists.

## Security considerations

- The setup token is generated with `uuid.NewString()` (crypto-random UUID), stored only in process memory, and compared with `crypto/subtle.ConstantTimeCompare` to prevent timing attacks.
- The token is never written to disk, never returned by any API endpoint, and is permanently invalidated after first use.
- Operators must have access to the process's stdout/log stream (`docker logs`, `kubectl logs`, or terminal) to retrieve the token, which is the same access level required to operate the host — this is the intended trust boundary.

## Checklist

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicablecg

* brings back onboarding widget (#5784)

## Summary

Briefly explain the purpose of this PR and the problem it solves.

## Changes

- What was changed and why
- Any notable design decisions or trade-offs

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

Describe the steps to validate this change. Include commands and expected outcomes.

```sh
# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

If adding new configs or environment variables, document them here.

## Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

## Breaking changes

- [ ] Yes
- [ ] No

If yes, describe impact and migration instructions.

## Related issues

Link related issues and discussions. Example: Closes #123

## Security considerations

Note any security implications (auth, secrets, PII, sandboxing, etc.).

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* path normalization auth bypass (#5763)

## Summary

Loading a custom plugin `path` causes native code (a `.so`) to be `dlopen()`'d directly into the gateway process. Previously, this was allowed even when dashboard authentication was disabled or unconfigured — meaning any caller who could reach the management API could inject arbitrary native code. This PR closes that gap by requiring a genuinely authenticated admin session for any create or update operation that sets a non-builtin plugin `path`, and separately hardens the plugin downloader against SSRF.

## Changes

- Added `BifrostContextKeyAuthBypassed` context key, set by the auth middleware exclusively when a request is let through because dashboard auth is disabled/unconfigured (distinct from `IsLocalAdminContextKey`, which is also set on real authenticated sessions).
- `createPlugin` and `updatePlugin` handlers now check `BifrostContextKeyAuthBypassed` and return `403` before any DB write when a non-builtin `path` is supplied without genuine authentication.
- Replaced the `fasthttp`-based plugin downloader with a `net/http` client backed by `network.SSRFSafeDialContext`, matching the SSRF hardening already applied to `core/providers/utils.FetchAndEncodeURL`. The new client: rejects non-`http`/`https` schemes before any network call, refuses connections to loopback, private, CGNAT, link-local, and unspecified addresses (including IPv4-in-IPv6 transition addresses) at dial time (not just DNS lookup time, so DNS rebinding doesn't bypass it), applies the same IP check to redirect targets, caps redirect depth at 5, and limits response body reads to 200 MB.
- Tests for `DownloadPlugin` now use a `useNonSSRFGuardedClient` helper that swaps in a plain dialer for the duration of each test (since `httptest` servers bind to loopback, which the production dialer correctly blocks). A new `TestDownloadPlugin_BlocksSSRFToLoopback` test verifies the production guard is active by default, and `TestDownloadPlugin_RejectsNonHTTPScheme` verifies `file://` and similar schemes are rejected before any network call.
- New handler tests cover all four cases: create with bypassed auth (expect 403, no DB write), create with real auth (expect 201, path stored), update with bypassed auth (expect 403, no DB write), and the existing config-merge behaviour.
- OpenAPI docs and the plugin sequencing guide updated to document the 403 response and the authentication requirement for `path`.
- Dependency bumps: `aws-sdk-go-v2/config` → v1.32.14, `aws-sdk-go-v2/service/s3` → v1.99.0, `aws-sdk-go-v2/internal/ini` → v1.8.6, `buger/jsonparser` → v1.2.0.

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [x] Chore/CI

> This is primarily a security hardening change.

## Affected areas

- [x] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [x] Plugins
- [ ] UI (React)
- [x] Docs

## How to test

```sh
# Run all tests
go test ./...

# Specifically verify the new plugin handler guards
go test ./transports/bifrost-http/handlers/... -run TestCreatePlugin_RejectsCustomPathWhenAuthBypassed
go test ./transports/bifrost-http/handlers/... -run TestCreatePlugin_AllowsCustomPathWhenNotBypassed
go test ./transports/bifrost-http/handlers/... -run TestUpdatePlugin_RejectsCustomPathWhenAuthBypassed

# Verify SSRF guard on plugin downloader
go test ./framework/plugins/... -run TestDownloadPlugin_BlocksSSRFToLoopback
go test ./framework/plugins/... -run TestDownloadPlugin_RejectsNonHTTPScheme
```

To manually verify the 403 behaviour: start the gateway with no dashboard auth configured, then attempt `POST /api/plugins` with a `path` field pointing to a `.so`. The response should be `403` with a message instructing the operator to enable dashboard authentication first.

## Breaking changes

- [x] Yes
- [ ] No

Operators running with dashboard authentication disabled who were previously able to create or update custom plugin paths via the API will now receive a `403`. To restore the capability, enable dashboard authentication and authenticate before calling those endpoints.

## Security considerations

- Closes an unauthenticated native code injection vector: without this change, any network-reachable caller could `dlopen()` an attacker-controlled `.so` into the gateway process when dashboard auth was off.
- The SSRF fix on the plugin downloader prevents a crafted plugin URL from causing the gateway to fetch from internal/metadata endpoints (e.g. cloud IMDS). The guard runs at dial time, not DNS resolution time, so DNS rebinding attacks do not bypass it.
- `BifrostContextKeyAuthBypassed` is intentionally separate from `IsLocalAdminContextKey` so that future handlers gating other high-risk operations can use the same signal without ambiguity.

## Checklist

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable

* go mod fixes (#5789)

## Summary

Briefly explain the purpose of this PR and the problem it solves.

## Changes

- What was changed and why
- Any notable design decisions or trade-offs

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

Describe the steps to validate this change. Include commands and expected outcomes.

```sh
# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

If adding new configs or environment variables, document them here.

## Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

## Breaking changes

- [ ] Yes
- [ ] No

If yes, describe impact and migration instructions.

## Related issues

Link related issues and discussions. Example: Closes #123

## Security considerations

Note any security implications (auth, secrets, PII, sandboxing, etc.).

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* [fix]: clear stuck entity-assignment validation on virtual key sheet (#5805)

* [fix]: clear stuck entity-assignment validation on virtual key sheet

Eager trigger on assignment-type changes left a refine error on entityType that selecting a team/customer never cleared; also align the assignment controls to items-start.

Co-authored-by: Cursor <cursoragent@cursor.com>

* [docs]: add before/after screenshots for virtual key entity-assignment fix

Co-authored-by: Cursor <cursoragent@cursor.com>

* [docs]: add on-submit validation screenshot for entity-assignment fix

Co-authored-by: Cursor <cursoragent@cursor.com>

* [chore]: remove PR screenshots from .github/assets

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(anthropic): cover message request extra params

* perf(anthropic): avoid copying known request fields

---------

Signed-off-by: Akshay Deo <akshay@akshaydeo.com>
Co-authored-by: jeremym-tanium <jeremy.maness@tanium.com>
Co-authored-by: Akshay Deo <akshay@akshaydeo.com>
Co-authored-by: Madhu Shantan <madhushantangot@gmail.com>
Co-authored-by: CMWR421 <182079927+CMWR421@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
akshaydeo added a commit that referenced this pull request Aug 7, 2026
## Summary

Resolves merge conflicts in `core/go.sum` that were left over from merging the path normalization auth bypass fix (#5763).

## Changes

- Removed leftover `<<<<<<< HEAD`, `=======`, and `>>>>>>> e0057ff` conflict markers from `core/go.sum`
- Retained the correct `go.mod` hash lines for `aws-sdk-go-v2/config`, `aws-sdk-go-v2/internal/ini`, and `aws-sdk-go-v2/service/s3` that were dropped during the conflict

## Type of change

- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [x] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

```sh
cd core
go mod verify
go test ./...
```

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

Closes #5763

## Security considerations

No security implications. This is a cleanup of unresolved merge conflict markers in the dependency lockfile.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
akshaydeo added a commit that referenced this pull request Aug 7, 2026
* feat: support matview_refresh_interval "off" to disable logstore matview maintenance (#5693)

* feat: support matview_refresh_interval "off" to disable logstore matview maintenance

The materialized views back only the dashboard UI. Deployments that run
Bifrost headless behind their own observability stack pay the REFRESH
MATERIALIZED VIEW CONCURRENTLY cost for views nothing reads, and the 5s
floor means the interval alone cannot turn maintenance off.

With "off" (or a non-positive duration) the logs store skips view
creation, the initial refresh, and the periodic refresher entirely.
matViewsReady stays false, so dashboard queries fall back to the raw
tables, and the runtime self-heal path cannot re-arm maintenance since
it only triggers from matview-path queries.

* fix: guard matview self-heal when maintenance is disabled

Review follow-up: carry the resolved disabled state onto the store so
triggerMatViewSelfHeal cannot recreate views the configuration says must
not exist, and make the schema/docs explicit that a zero duration also
disables (positive sub-5s values still clamp up).

* V2.0.0 (#4365)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **Bug Fixes**
  * Improved token parameter compatibility handling to preserve alternative formats when the primary option is unsupported.

* **Chores**
  * Version updated to 2.0.0.
  * Enhanced load testing configuration for more reliable builds.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

* gomod fixes (#5731)

## Summary

Briefly explain the purpose of this PR and the problem it solves.

## Changes

- What was changed and why
- Any notable design decisions or trade-offs

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

Describe the steps to validate this change. Include commands and expected outcomes.

```sh
# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

If adding new configs or environment variables, document them here.

## Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

## Breaking changes

- [ ] Yes
- [ ] No

If yes, describe impact and migration instructions.

## Related issues

Link related issues and discussions. Example: Closes #123

## Security considerations

Note any security implications (auth, secrets, PII, sandboxing, etc.).

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* third party notice (#5735)

## Summary

Adds a `THIRD_PARTY_NOTICES.md` file to formally document third-party components used in Bifrost that carry license terms requiring explicit attribution — specifically MPL-2.0 licensed dependencies and embedded source code derived from external projects.

## Changes

- Introduces `THIRD_PARTY_NOTICES.md` to attribute:
  - Embedded source code in `framework/migrator/migrator.go` derived from `go-gormigrate/gormigrate` (MIT)
  - Go binary dependencies carrying MPL-2.0 terms: `github.com/cyphar/filepath-securejoin` and `github.com/hashicorp/go-version`
  - npm build-time devDependencies carrying MPL-2.0 terms: `lightningcss` (never shipped to end users) and `dompurify` (Apache-2.0 option elected)
- All MPL-2.0 components are used unmodified and combined as a "Larger Work" per MPL-2.0 Section 3.3; no Bifrost source files are themselves MPL-licensed.

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [x] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [x] Docs

## How to test

No functional changes — review the file contents to confirm accuracy of license attributions against the listed upstream repositories.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

N/A

## Security considerations

This change has no security implications. It is a legal/compliance attribution document only.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* feat(mcp-guardrails): add MCP log redaction changes (#5744)

## Summary

Briefly explain the purpose of this PR and the problem it solves.

## Changes

- What was changed and why
- Any notable design decisions or trade-offs

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

Describe the steps to validate this change. Include commands and expected outcomes.

```sh
# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

If adding new configs or environment variables, document them here.

## Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

## Breaking changes

- [ ] Yes
- [ ] No

If yes, describe impact and migration instructions.

## Related issues

Link related issues and discussions. Example: Closes #123

## Security considerations

Note any security implications (auth, secrets, PII, sandboxing, etc.).

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* feat(mcp-guardrails): ui changes (#5745)

## Summary

Briefly explain the purpose of this PR and the problem it solves.

## Changes

- What was changed and why
- Any notable design decisions or trade-offs

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

Describe the steps to validate this change. Include commands and expected outcomes.

```sh
# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

If adding new configs or environment variables, document them here.

## Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

## Breaking changes

- [ ] Yes
- [ ] No

If yes, describe impact and migration instructions.

## Related issues

Link related issues and discussions. Example: Closes #123

## Security considerations

Note any security implications (auth, secrets, PII, sandboxing, etc.).

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* added plugin logs in mcp logs (#5746)

## Summary

Briefly explain the purpose of this PR and the problem it solves.

## Changes

- What was changed and why
- Any notable design decisions or trade-offs

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

Describe the steps to validate this change. Include commands and expected outcomes.

```sh
# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

If adding new configs or environment variables, document them here.

## Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

## Breaking changes

- [ ] Yes
- [ ] No

If yes, describe impact and migration instructions.

## Related issues

Link related issues and discussions. Example: Closes #123

## Security considerations

Note any security implications (auth, secrets, PII, sandboxing, etc.).

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* dependabot alert fixes (#5756)

## Summary

Bumps several Go dependencies to their latest patch/minor versions across all modules in the repository.

## Changes

- `github.com/aws/aws-sdk-go-v2/service/s3`: `v1.97.3` → `v1.99.0`
- `github.com/aws/aws-sdk-go-v2/config`: `v1.32.11` → `v1.32.14`
- `github.com/aws/aws-sdk-go-v2/internal/ini`: `v1.8.5` → `v1.8.6`
- `github.com/weaviate/weaviate`: `v1.36.5` → `v1.38.0`
- `github.com/buger/jsonparser`: `v1.1.2` → `v1.2.0`
- `github.com/go-openapi/spec`: `v0.22.2` → `v0.22.3`
- `github.com/google/cel-go`: `v0.28.1` → `v0.29.0`
- `github.com/stretchr/objx`: `v0.5.3` added as an indirect dependency

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [x] Chore/CI

## Affected areas

- [x] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [x] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

```sh
go test ./...
```

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

None. All changes are dependency version bumps with no security-sensitive modifications.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* mcp guardrails : config,helm and docs changes (#5758)

* adds first time setup token to avoid opening new setup to the world (#5759)

## Summary

Closes a race-condition security gap where an unauthenticated network caller could reach a freshly deployed, not-yet-configured Bifrost instance and create the first admin account before the real operator does. Previously, `PUT /api/config` was intentionally open when no admin account existed (zero-config UX), but this left a window of exposure on any publicly reachable host.

The fix introduces a one-time **setup token** — generated in-memory at startup when no admin account is configured, printed to the server's startup logs, and required alongside the username/password when creating the first admin account. The token is never persisted, is regenerated on every restart until an admin account exists, and is permanently invalidated once the first admin account is created.

## Changes

- **Bootstrap token generation (`middlewares.go`):** `InitAuthMiddleware` generates a UUID setup token via `atomic.Pointer[string]` when no admin account is configured, logs it prominently to stdout, and exposes `CheckBootstrapToken` (constant-time comparison) and `ClearBootstrapToken` methods.
- **Token validation in the config handler (`config.go`):** `updateConfig` now calls `ValidateSetupToken` before allowing the first admin account to be created. Returns HTTP 403 if the token is missing or wrong.
- **Token cleared on first admin account creation (`server.go`):** `UpdateAuthConfig` calls `ClearBootstrapToken` after successfully persisting the first admin account, permanently closing the gate.
- **`setup_token`** **field added to** **`UpdateConfigRequest`:** The field is accepted in the request body but never persisted or returned by `GET /api/config`.
- **UI (`securityView.tsx`):** When no `auth_config` exists server-side (`isFirstTimeSetup`), a **Setup token** input field is shown below the password field. The token is validated client-side before submission and cleared from state after a successful save.
- **TypeScript types (`config.ts`):** `setup_token?: string` added to `BifrostConfig`.
- **OpenAPI schema (`config.yaml`):** `setup_token` documented on `UpdateConfigRequest`.
- **Docs:** A `<Warning>` block added to `security-best-practices.mdx` and a `<Note>` added to `setting-up-auth.mdx` explaining the setup token flow, where to find it, and that it only applies once.
- **Tests (`middlewares_test.go`):** Two new test cases cover the no-token-generated (pass-through) case and the validate-then-clear lifecycle.

## Type of change

- [ ] Bug fix
- [x] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [x] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [x] UI (React)
- [x] Docs

## How to test

**Manual flow:**

1. Start a fresh Bifrost instance with no existing admin account.
2. Check startup logs for the block beginning `No admin account is configured for this Bifrost instance yet.` and copy the setup token.
3. Open the dashboard → Security Settings. Confirm the **Setup token** field appears below the password field.
4. Attempt to save with auth enabled but without the setup token — expect a toast error.
5. Paste the correct token and save — expect success and the Setup token field to disappear on reload.
6. Confirm that `PUT /api/config` without the token returns HTTP 403 while no admin account exists.
7. Restart the server before completing setup and confirm a new token is printed.

```sh
# Core/Transports
go test ./transports/bifrost-http/handlers/...

# UI
cd ui
pnpm i
pnpm build
```

## Breaking changes

- [x] Yes
- [ ] No

Any automation or scripts that call `PUT /api/config` to create the first admin account on a fresh instance must now include `setup_token` in the request body. The token is available in the server's startup logs. Instances that already have an admin account configured are unaffected — the field is ignored once an admin account exists.

## Security considerations

- The setup token is generated with `uuid.NewString()` (crypto-random UUID), stored only in process memory, and compared with `crypto/subtle.ConstantTimeCompare` to prevent timing attacks.
- The token is never written to disk, never returned by any API endpoint, and is permanently invalidated after first use.
- Operators must have access to the process's stdout/log stream (`docker logs`, `kubectl logs`, or terminal) to retrieve the token, which is the same access level required to operate the host — this is the intended trust boundary.

## Checklist

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicablecg

* brings back onboarding widget (#5784)

## Summary

Briefly explain the purpose of this PR and the problem it solves.

## Changes

- What was changed and why
- Any notable design decisions or trade-offs

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

Describe the steps to validate this change. Include commands and expected outcomes.

```sh
# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

If adding new configs or environment variables, document them here.

## Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

## Breaking changes

- [ ] Yes
- [ ] No

If yes, describe impact and migration instructions.

## Related issues

Link related issues and discussions. Example: Closes #123

## Security considerations

Note any security implications (auth, secrets, PII, sandboxing, etc.).

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* path normalization auth bypass (#5763)

## Summary

Loading a custom plugin `path` causes native code (a `.so`) to be `dlopen()`'d directly into the gateway process. Previously, this was allowed even when dashboard authentication was disabled or unconfigured — meaning any caller who could reach the management API could inject arbitrary native code. This PR closes that gap by requiring a genuinely authenticated admin session for any create or update operation that sets a non-builtin plugin `path`, and separately hardens the plugin downloader against SSRF.

## Changes

- Added `BifrostContextKeyAuthBypassed` context key, set by the auth middleware exclusively when a request is let through because dashboard auth is disabled/unconfigured (distinct from `IsLocalAdminContextKey`, which is also set on real authenticated sessions).
- `createPlugin` and `updatePlugin` handlers now check `BifrostContextKeyAuthBypassed` and return `403` before any DB write when a non-builtin `path` is supplied without genuine authentication.
- Replaced the `fasthttp`-based plugin downloader with a `net/http` client backed by `network.SSRFSafeDialContext`, matching the SSRF hardening already applied to `core/providers/utils.FetchAndEncodeURL`. The new client: rejects non-`http`/`https` schemes before any network call, refuses connections to loopback, private, CGNAT, link-local, and unspecified addresses (including IPv4-in-IPv6 transition addresses) at dial time (not just DNS lookup time, so DNS rebinding doesn't bypass it), applies the same IP check to redirect targets, caps redirect depth at 5, and limits response body reads to 200 MB.
- Tests for `DownloadPlugin` now use a `useNonSSRFGuardedClient` helper that swaps in a plain dialer for the duration of each test (since `httptest` servers bind to loopback, which the production dialer correctly blocks). A new `TestDownloadPlugin_BlocksSSRFToLoopback` test verifies the production guard is active by default, and `TestDownloadPlugin_RejectsNonHTTPScheme` verifies `file://` and similar schemes are rejected before any network call.
- New handler tests cover all four cases: create with bypassed auth (expect 403, no DB write), create with real auth (expect 201, path stored), update with bypassed auth (expect 403, no DB write), and the existing config-merge behaviour.
- OpenAPI docs and the plugin sequencing guide updated to document the 403 response and the authentication requirement for `path`.
- Dependency bumps: `aws-sdk-go-v2/config` → v1.32.14, `aws-sdk-go-v2/service/s3` → v1.99.0, `aws-sdk-go-v2/internal/ini` → v1.8.6, `buger/jsonparser` → v1.2.0.

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [x] Chore/CI

> This is primarily a security hardening change.

## Affected areas

- [x] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [x] Plugins
- [ ] UI (React)
- [x] Docs

## How to test

```sh
# Run all tests
go test ./...

# Specifically verify the new plugin handler guards
go test ./transports/bifrost-http/handlers/... -run TestCreatePlugin_RejectsCustomPathWhenAuthBypassed
go test ./transports/bifrost-http/handlers/... -run TestCreatePlugin_AllowsCustomPathWhenNotBypassed
go test ./transports/bifrost-http/handlers/... -run TestUpdatePlugin_RejectsCustomPathWhenAuthBypassed

# Verify SSRF guard on plugin downloader
go test ./framework/plugins/... -run TestDownloadPlugin_BlocksSSRFToLoopback
go test ./framework/plugins/... -run TestDownloadPlugin_RejectsNonHTTPScheme
```

To manually verify the 403 behaviour: start the gateway with no dashboard auth configured, then attempt `POST /api/plugins` with a `path` field pointing to a `.so`. The response should be `403` with a message instructing the operator to enable dashboard authentication first.

## Breaking changes

- [x] Yes
- [ ] No

Operators running with dashboard authentication disabled who were previously able to create or update custom plugin paths via the API will now receive a `403`. To restore the capability, enable dashboard authentication and authenticate before calling those endpoints.

## Security considerations

- Closes an unauthenticated native code injection vector: without this change, any network-reachable caller could `dlopen()` an attacker-controlled `.so` into the gateway process when dashboard auth was off.
- The SSRF fix on the plugin downloader prevents a crafted plugin URL from causing the gateway to fetch from internal/metadata endpoints (e.g. cloud IMDS). The guard runs at dial time, not DNS resolution time, so DNS rebinding attacks do not bypass it.
- `BifrostContextKeyAuthBypassed` is intentionally separate from `IsLocalAdminContextKey` so that future handlers gating other high-risk operations can use the same signal without ambiguity.

## Checklist

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable

* go mod fixes (#5789)

## Summary

Briefly explain the purpose of this PR and the problem it solves.

## Changes

- What was changed and why
- Any notable design decisions or trade-offs

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

Describe the steps to validate this change. Include commands and expected outcomes.

```sh
# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

If adding new configs or environment variables, document them here.

## Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

## Breaking changes

- [ ] Yes
- [ ] No

If yes, describe impact and migration instructions.

## Related issues

Link related issues and discussions. Example: Closes #123

## Security considerations

Note any security implications (auth, secrets, PII, sandboxing, etc.).

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* [fix]: clear stuck entity-assignment validation on virtual key sheet (#5805)

* [fix]: clear stuck entity-assignment validation on virtual key sheet

Eager trigger on assignment-type changes left a refine error on entityType that selecting a team/customer never cleared; also align the assignment controls to items-start.

Co-authored-by: Cursor <cursoragent@cursor.com>

* [docs]: add before/after screenshots for virtual key entity-assignment fix

Co-authored-by: Cursor <cursoragent@cursor.com>

* [docs]: add on-submit validation screenshot for entity-assignment fix

Co-authored-by: Cursor <cursoragent@cursor.com>

* [chore]: remove PR screenshots from .github/assets

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(anthropic): cover message request extra params

* perf(anthropic): avoid copying known request fields

---------

Signed-off-by: Akshay Deo <akshay@akshaydeo.com>
Co-authored-by: jeremym-tanium <jeremy.maness@tanium.com>
Co-authored-by: Akshay Deo <akshay@akshaydeo.com>
Co-authored-by: Madhu Shantan <madhushantangot@gmail.com>
Co-authored-by: CMWR421 <182079927+CMWR421@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
soby added a commit to soby/bifrost that referenced this pull request Aug 7, 2026
Upstream recreated dev's history, so the same changes (maximhq#5758 mcp
guardrails, maximhq#4365 V2.0.0, maximhq#5763 path normalization) existed on this
branch under dead SHAs and conflicted with their rewritten copies.
Resolved by taking dev's side for all upstream-owned files and
unioning the three files this branch genuinely touches:

- core/schemas/provider.go: keep both new constants
  (DynamicProviderTransportTimeoutCeilingInSeconds ours,
  HTTP2PingIntervalUpperBoundSeconds dev's)
- core/providers/utils/utils.go: keep our setExtraHeadersMap/
  shouldSkipHeader refactor alongside dev's new SetPassthroughHeaders
- core/bifrost.go: retry loop now honours the per-request
  effectiveConfig overlay AND dev's encrypted-reasoning fail-soft
  extraAttempts (bound is effectiveConfig MaxRetries+extraAttempts;
  backoff skip includes lastWasEncryptedContentStrip)
akshaydeo added a commit that referenced this pull request Aug 10, 2026
Loading a custom plugin `path` causes native code (a `.so`) to be `dlopen()`'d directly into the gateway process. Previously, this was allowed even when dashboard authentication was disabled or unconfigured — meaning any caller who could reach the management API could inject arbitrary native code. This PR closes that gap by requiring a genuinely authenticated admin session for any create or update operation that sets a non-builtin plugin `path`, and separately hardens the plugin downloader against SSRF.

- Added `BifrostContextKeyAuthBypassed` context key, set by the auth middleware exclusively when a request is let through because dashboard auth is disabled/unconfigured (distinct from `IsLocalAdminContextKey`, which is also set on real authenticated sessions).
- `createPlugin` and `updatePlugin` handlers now check `BifrostContextKeyAuthBypassed` and return `403` before any DB write when a non-builtin `path` is supplied without genuine authentication.
- Replaced the `fasthttp`-based plugin downloader with a `net/http` client backed by `network.SSRFSafeDialContext`, matching the SSRF hardening already applied to `core/providers/utils.FetchAndEncodeURL`. The new client: rejects non-`http`/`https` schemes before any network call, refuses connections to loopback, private, CGNAT, link-local, and unspecified addresses (including IPv4-in-IPv6 transition addresses) at dial time (not just DNS lookup time, so DNS rebinding doesn't bypass it), applies the same IP check to redirect targets, caps redirect depth at 5, and limits response body reads to 200 MB.
- Tests for `DownloadPlugin` now use a `useNonSSRFGuardedClient` helper that swaps in a plain dialer for the duration of each test (since `httptest` servers bind to loopback, which the production dialer correctly blocks). A new `TestDownloadPlugin_BlocksSSRFToLoopback` test verifies the production guard is active by default, and `TestDownloadPlugin_RejectsNonHTTPScheme` verifies `file://` and similar schemes are rejected before any network call.
- New handler tests cover all four cases: create with bypassed auth (expect 403, no DB write), create with real auth (expect 201, path stored), update with bypassed auth (expect 403, no DB write), and the existing config-merge behaviour.
- OpenAPI docs and the plugin sequencing guide updated to document the 403 response and the authentication requirement for `path`.
- Dependency bumps: `aws-sdk-go-v2/config` → v1.32.14, `aws-sdk-go-v2/service/s3` → v1.99.0, `aws-sdk-go-v2/internal/ini` → v1.8.6, `buger/jsonparser` → v1.2.0.

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [x] Chore/CI

> This is primarily a security hardening change.

- [x] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [x] Plugins
- [ ] UI (React)
- [x] Docs

```sh
go test ./...

go test ./transports/bifrost-http/handlers/... -run TestCreatePlugin_RejectsCustomPathWhenAuthBypassed
go test ./transports/bifrost-http/handlers/... -run TestCreatePlugin_AllowsCustomPathWhenNotBypassed
go test ./transports/bifrost-http/handlers/... -run TestUpdatePlugin_RejectsCustomPathWhenAuthBypassed

go test ./framework/plugins/... -run TestDownloadPlugin_BlocksSSRFToLoopback
go test ./framework/plugins/... -run TestDownloadPlugin_RejectsNonHTTPScheme
```

To manually verify the 403 behaviour: start the gateway with no dashboard auth configured, then attempt `POST /api/plugins` with a `path` field pointing to a `.so`. The response should be `403` with a message instructing the operator to enable dashboard authentication first.

- [x] Yes
- [ ] No

Operators running with dashboard authentication disabled who were previously able to create or update custom plugin paths via the API will now receive a `403`. To restore the capability, enable dashboard authentication and authenticate before calling those endpoints.

- Closes an unauthenticated native code injection vector: without this change, any network-reachable caller could `dlopen()` an attacker-controlled `.so` into the gateway process when dashboard auth was off.
- The SSRF fix on the plugin downloader prevents a crafted plugin URL from causing the gateway to fetch from internal/metadata endpoints (e.g. cloud IMDS). The guard runs at dial time, not DNS resolution time, so DNS rebinding attacks do not bypass it.
- `BifrostContextKeyAuthBypassed` is intentionally separate from `IsLocalAdminContextKey` so that future handlers gating other high-risk operations can use the same signal without ambiguity.

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable
akshaydeo added a commit that referenced this pull request Aug 10, 2026
## Summary

Resolves merge conflicts in `core/go.sum` that were left over from merging the path normalization auth bypass fix (#5763).

## Changes

- Removed leftover `<<<<<<< HEAD`, `=======`, and `>>>>>>> e0057ff` conflict markers from `core/go.sum`
- Retained the correct `go.mod` hash lines for `aws-sdk-go-v2/config`, `aws-sdk-go-v2/internal/ini`, and `aws-sdk-go-v2/service/s3` that were dropped during the conflict

## Type of change

- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [x] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

```sh
cd core
go mod verify
go test ./...
```

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

Closes #5763

## Security considerations

No security implications. This is a cleanup of unresolved merge conflict markers in the dependency lockfile.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
atharvamhaske pushed a commit to atharvamhaske/bifrost that referenced this pull request Aug 13, 2026
## Summary

Resolves merge conflicts in `core/go.sum` that were left over from merging the path normalization auth bypass fix (maximhq#5763).

## Changes

- Removed leftover `<<<<<<< HEAD`, `=======`, and `>>>>>>> e0057ff` conflict markers from `core/go.sum`
- Retained the correct `go.mod` hash lines for `aws-sdk-go-v2/config`, `aws-sdk-go-v2/internal/ini`, and `aws-sdk-go-v2/service/s3` that were dropped during the conflict

## Type of change

- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [x] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

```sh
cd core
go mod verify
go test ./...
```

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

Closes maximhq#5763

## Security considerations

No security implications. This is a cleanup of unresolved merge conflict markers in the dependency lockfile.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
atharvamhaske pushed a commit to atharvamhaske/bifrost that referenced this pull request Aug 13, 2026
* feat: support matview_refresh_interval "off" to disable logstore matview maintenance (maximhq#5693)

* feat: support matview_refresh_interval "off" to disable logstore matview maintenance

The materialized views back only the dashboard UI. Deployments that run
Bifrost headless behind their own observability stack pay the REFRESH
MATERIALIZED VIEW CONCURRENTLY cost for views nothing reads, and the 5s
floor means the interval alone cannot turn maintenance off.

With "off" (or a non-positive duration) the logs store skips view
creation, the initial refresh, and the periodic refresher entirely.
matViewsReady stays false, so dashboard queries fall back to the raw
tables, and the runtime self-heal path cannot re-arm maintenance since
it only triggers from matview-path queries.

* fix: guard matview self-heal when maintenance is disabled

Review follow-up: carry the resolved disabled state onto the store so
triggerMatViewSelfHeal cannot recreate views the configuration says must
not exist, and make the schema/docs explicit that a zero duration also
disables (positive sub-5s values still clamp up).

* V2.0.0 (maximhq#4365)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **Bug Fixes**
  * Improved token parameter compatibility handling to preserve alternative formats when the primary option is unsupported.

* **Chores**
  * Version updated to 2.0.0.
  * Enhanced load testing configuration for more reliable builds.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

* gomod fixes (maximhq#5731)

## Summary

Briefly explain the purpose of this PR and the problem it solves.

## Changes

- What was changed and why
- Any notable design decisions or trade-offs

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

Describe the steps to validate this change. Include commands and expected outcomes.

```sh
# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

If adding new configs or environment variables, document them here.

## Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

## Breaking changes

- [ ] Yes
- [ ] No

If yes, describe impact and migration instructions.

## Related issues

Link related issues and discussions. Example: Closes maximhq#123

## Security considerations

Note any security implications (auth, secrets, PII, sandboxing, etc.).

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* third party notice (maximhq#5735)

## Summary

Adds a `THIRD_PARTY_NOTICES.md` file to formally document third-party components used in Bifrost that carry license terms requiring explicit attribution — specifically MPL-2.0 licensed dependencies and embedded source code derived from external projects.

## Changes

- Introduces `THIRD_PARTY_NOTICES.md` to attribute:
  - Embedded source code in `framework/migrator/migrator.go` derived from `go-gormigrate/gormigrate` (MIT)
  - Go binary dependencies carrying MPL-2.0 terms: `github.com/cyphar/filepath-securejoin` and `github.com/hashicorp/go-version`
  - npm build-time devDependencies carrying MPL-2.0 terms: `lightningcss` (never shipped to end users) and `dompurify` (Apache-2.0 option elected)
- All MPL-2.0 components are used unmodified and combined as a "Larger Work" per MPL-2.0 Section 3.3; no Bifrost source files are themselves MPL-licensed.

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [x] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [x] Docs

## How to test

No functional changes — review the file contents to confirm accuracy of license attributions against the listed upstream repositories.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

N/A

## Security considerations

This change has no security implications. It is a legal/compliance attribution document only.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* feat(mcp-guardrails): add MCP log redaction changes (maximhq#5744)

## Summary

Briefly explain the purpose of this PR and the problem it solves.

## Changes

- What was changed and why
- Any notable design decisions or trade-offs

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

Describe the steps to validate this change. Include commands and expected outcomes.

```sh
# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

If adding new configs or environment variables, document them here.

## Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

## Breaking changes

- [ ] Yes
- [ ] No

If yes, describe impact and migration instructions.

## Related issues

Link related issues and discussions. Example: Closes maximhq#123

## Security considerations

Note any security implications (auth, secrets, PII, sandboxing, etc.).

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* feat(mcp-guardrails): ui changes (maximhq#5745)

## Summary

Briefly explain the purpose of this PR and the problem it solves.

## Changes

- What was changed and why
- Any notable design decisions or trade-offs

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

Describe the steps to validate this change. Include commands and expected outcomes.

```sh
# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

If adding new configs or environment variables, document them here.

## Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

## Breaking changes

- [ ] Yes
- [ ] No

If yes, describe impact and migration instructions.

## Related issues

Link related issues and discussions. Example: Closes maximhq#123

## Security considerations

Note any security implications (auth, secrets, PII, sandboxing, etc.).

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* added plugin logs in mcp logs (maximhq#5746)

## Summary

Briefly explain the purpose of this PR and the problem it solves.

## Changes

- What was changed and why
- Any notable design decisions or trade-offs

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

Describe the steps to validate this change. Include commands and expected outcomes.

```sh
# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

If adding new configs or environment variables, document them here.

## Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

## Breaking changes

- [ ] Yes
- [ ] No

If yes, describe impact and migration instructions.

## Related issues

Link related issues and discussions. Example: Closes maximhq#123

## Security considerations

Note any security implications (auth, secrets, PII, sandboxing, etc.).

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* dependabot alert fixes (maximhq#5756)

## Summary

Bumps several Go dependencies to their latest patch/minor versions across all modules in the repository.

## Changes

- `github.com/aws/aws-sdk-go-v2/service/s3`: `v1.97.3` → `v1.99.0`
- `github.com/aws/aws-sdk-go-v2/config`: `v1.32.11` → `v1.32.14`
- `github.com/aws/aws-sdk-go-v2/internal/ini`: `v1.8.5` → `v1.8.6`
- `github.com/weaviate/weaviate`: `v1.36.5` → `v1.38.0`
- `github.com/buger/jsonparser`: `v1.1.2` → `v1.2.0`
- `github.com/go-openapi/spec`: `v0.22.2` → `v0.22.3`
- `github.com/google/cel-go`: `v0.28.1` → `v0.29.0`
- `github.com/stretchr/objx`: `v0.5.3` added as an indirect dependency

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [x] Chore/CI

## Affected areas

- [x] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [x] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

```sh
go test ./...
```

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

None. All changes are dependency version bumps with no security-sensitive modifications.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* mcp guardrails : config,helm and docs changes (maximhq#5758)

* adds first time setup token to avoid opening new setup to the world (maximhq#5759)

## Summary

Closes a race-condition security gap where an unauthenticated network caller could reach a freshly deployed, not-yet-configured Bifrost instance and create the first admin account before the real operator does. Previously, `PUT /api/config` was intentionally open when no admin account existed (zero-config UX), but this left a window of exposure on any publicly reachable host.

The fix introduces a one-time **setup token** — generated in-memory at startup when no admin account is configured, printed to the server's startup logs, and required alongside the username/password when creating the first admin account. The token is never persisted, is regenerated on every restart until an admin account exists, and is permanently invalidated once the first admin account is created.

## Changes

- **Bootstrap token generation (`middlewares.go`):** `InitAuthMiddleware` generates a UUID setup token via `atomic.Pointer[string]` when no admin account is configured, logs it prominently to stdout, and exposes `CheckBootstrapToken` (constant-time comparison) and `ClearBootstrapToken` methods.
- **Token validation in the config handler (`config.go`):** `updateConfig` now calls `ValidateSetupToken` before allowing the first admin account to be created. Returns HTTP 403 if the token is missing or wrong.
- **Token cleared on first admin account creation (`server.go`):** `UpdateAuthConfig` calls `ClearBootstrapToken` after successfully persisting the first admin account, permanently closing the gate.
- **`setup_token`** **field added to** **`UpdateConfigRequest`:** The field is accepted in the request body but never persisted or returned by `GET /api/config`.
- **UI (`securityView.tsx`):** When no `auth_config` exists server-side (`isFirstTimeSetup`), a **Setup token** input field is shown below the password field. The token is validated client-side before submission and cleared from state after a successful save.
- **TypeScript types (`config.ts`):** `setup_token?: string` added to `BifrostConfig`.
- **OpenAPI schema (`config.yaml`):** `setup_token` documented on `UpdateConfigRequest`.
- **Docs:** A `<Warning>` block added to `security-best-practices.mdx` and a `<Note>` added to `setting-up-auth.mdx` explaining the setup token flow, where to find it, and that it only applies once.
- **Tests (`middlewares_test.go`):** Two new test cases cover the no-token-generated (pass-through) case and the validate-then-clear lifecycle.

## Type of change

- [ ] Bug fix
- [x] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [x] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [x] UI (React)
- [x] Docs

## How to test

**Manual flow:**

1. Start a fresh Bifrost instance with no existing admin account.
2. Check startup logs for the block beginning `No admin account is configured for this Bifrost instance yet.` and copy the setup token.
3. Open the dashboard → Security Settings. Confirm the **Setup token** field appears below the password field.
4. Attempt to save with auth enabled but without the setup token — expect a toast error.
5. Paste the correct token and save — expect success and the Setup token field to disappear on reload.
6. Confirm that `PUT /api/config` without the token returns HTTP 403 while no admin account exists.
7. Restart the server before completing setup and confirm a new token is printed.

```sh
# Core/Transports
go test ./transports/bifrost-http/handlers/...

# UI
cd ui
pnpm i
pnpm build
```

## Breaking changes

- [x] Yes
- [ ] No

Any automation or scripts that call `PUT /api/config` to create the first admin account on a fresh instance must now include `setup_token` in the request body. The token is available in the server's startup logs. Instances that already have an admin account configured are unaffected — the field is ignored once an admin account exists.

## Security considerations

- The setup token is generated with `uuid.NewString()` (crypto-random UUID), stored only in process memory, and compared with `crypto/subtle.ConstantTimeCompare` to prevent timing attacks.
- The token is never written to disk, never returned by any API endpoint, and is permanently invalidated after first use.
- Operators must have access to the process's stdout/log stream (`docker logs`, `kubectl logs`, or terminal) to retrieve the token, which is the same access level required to operate the host — this is the intended trust boundary.

## Checklist

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicablecg

* brings back onboarding widget (maximhq#5784)

## Summary

Briefly explain the purpose of this PR and the problem it solves.

## Changes

- What was changed and why
- Any notable design decisions or trade-offs

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

Describe the steps to validate this change. Include commands and expected outcomes.

```sh
# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

If adding new configs or environment variables, document them here.

## Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

## Breaking changes

- [ ] Yes
- [ ] No

If yes, describe impact and migration instructions.

## Related issues

Link related issues and discussions. Example: Closes maximhq#123

## Security considerations

Note any security implications (auth, secrets, PII, sandboxing, etc.).

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* path normalization auth bypass (maximhq#5763)

## Summary

Loading a custom plugin `path` causes native code (a `.so`) to be `dlopen()`'d directly into the gateway process. Previously, this was allowed even when dashboard authentication was disabled or unconfigured — meaning any caller who could reach the management API could inject arbitrary native code. This PR closes that gap by requiring a genuinely authenticated admin session for any create or update operation that sets a non-builtin plugin `path`, and separately hardens the plugin downloader against SSRF.

## Changes

- Added `BifrostContextKeyAuthBypassed` context key, set by the auth middleware exclusively when a request is let through because dashboard auth is disabled/unconfigured (distinct from `IsLocalAdminContextKey`, which is also set on real authenticated sessions).
- `createPlugin` and `updatePlugin` handlers now check `BifrostContextKeyAuthBypassed` and return `403` before any DB write when a non-builtin `path` is supplied without genuine authentication.
- Replaced the `fasthttp`-based plugin downloader with a `net/http` client backed by `network.SSRFSafeDialContext`, matching the SSRF hardening already applied to `core/providers/utils.FetchAndEncodeURL`. The new client: rejects non-`http`/`https` schemes before any network call, refuses connections to loopback, private, CGNAT, link-local, and unspecified addresses (including IPv4-in-IPv6 transition addresses) at dial time (not just DNS lookup time, so DNS rebinding doesn't bypass it), applies the same IP check to redirect targets, caps redirect depth at 5, and limits response body reads to 200 MB.
- Tests for `DownloadPlugin` now use a `useNonSSRFGuardedClient` helper that swaps in a plain dialer for the duration of each test (since `httptest` servers bind to loopback, which the production dialer correctly blocks). A new `TestDownloadPlugin_BlocksSSRFToLoopback` test verifies the production guard is active by default, and `TestDownloadPlugin_RejectsNonHTTPScheme` verifies `file://` and similar schemes are rejected before any network call.
- New handler tests cover all four cases: create with bypassed auth (expect 403, no DB write), create with real auth (expect 201, path stored), update with bypassed auth (expect 403, no DB write), and the existing config-merge behaviour.
- OpenAPI docs and the plugin sequencing guide updated to document the 403 response and the authentication requirement for `path`.
- Dependency bumps: `aws-sdk-go-v2/config` → v1.32.14, `aws-sdk-go-v2/service/s3` → v1.99.0, `aws-sdk-go-v2/internal/ini` → v1.8.6, `buger/jsonparser` → v1.2.0.

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [x] Chore/CI

> This is primarily a security hardening change.

## Affected areas

- [x] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [x] Plugins
- [ ] UI (React)
- [x] Docs

## How to test

```sh
# Run all tests
go test ./...

# Specifically verify the new plugin handler guards
go test ./transports/bifrost-http/handlers/... -run TestCreatePlugin_RejectsCustomPathWhenAuthBypassed
go test ./transports/bifrost-http/handlers/... -run TestCreatePlugin_AllowsCustomPathWhenNotBypassed
go test ./transports/bifrost-http/handlers/... -run TestUpdatePlugin_RejectsCustomPathWhenAuthBypassed

# Verify SSRF guard on plugin downloader
go test ./framework/plugins/... -run TestDownloadPlugin_BlocksSSRFToLoopback
go test ./framework/plugins/... -run TestDownloadPlugin_RejectsNonHTTPScheme
```

To manually verify the 403 behaviour: start the gateway with no dashboard auth configured, then attempt `POST /api/plugins` with a `path` field pointing to a `.so`. The response should be `403` with a message instructing the operator to enable dashboard authentication first.

## Breaking changes

- [x] Yes
- [ ] No

Operators running with dashboard authentication disabled who were previously able to create or update custom plugin paths via the API will now receive a `403`. To restore the capability, enable dashboard authentication and authenticate before calling those endpoints.

## Security considerations

- Closes an unauthenticated native code injection vector: without this change, any network-reachable caller could `dlopen()` an attacker-controlled `.so` into the gateway process when dashboard auth was off.
- The SSRF fix on the plugin downloader prevents a crafted plugin URL from causing the gateway to fetch from internal/metadata endpoints (e.g. cloud IMDS). The guard runs at dial time, not DNS resolution time, so DNS rebinding attacks do not bypass it.
- `BifrostContextKeyAuthBypassed` is intentionally separate from `IsLocalAdminContextKey` so that future handlers gating other high-risk operations can use the same signal without ambiguity.

## Checklist

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable

* go mod fixes (maximhq#5789)

## Summary

Briefly explain the purpose of this PR and the problem it solves.

## Changes

- What was changed and why
- Any notable design decisions or trade-offs

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

Describe the steps to validate this change. Include commands and expected outcomes.

```sh
# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

If adding new configs or environment variables, document them here.

## Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

## Breaking changes

- [ ] Yes
- [ ] No

If yes, describe impact and migration instructions.

## Related issues

Link related issues and discussions. Example: Closes maximhq#123

## Security considerations

Note any security implications (auth, secrets, PII, sandboxing, etc.).

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* [fix]: clear stuck entity-assignment validation on virtual key sheet (maximhq#5805)

* [fix]: clear stuck entity-assignment validation on virtual key sheet

Eager trigger on assignment-type changes left a refine error on entityType that selecting a team/customer never cleared; also align the assignment controls to items-start.

Co-authored-by: Cursor <cursoragent@cursor.com>

* [docs]: add before/after screenshots for virtual key entity-assignment fix

Co-authored-by: Cursor <cursoragent@cursor.com>

* [docs]: add on-submit validation screenshot for entity-assignment fix

Co-authored-by: Cursor <cursoragent@cursor.com>

* [chore]: remove PR screenshots from .github/assets

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(anthropic): cover message request extra params

* perf(anthropic): avoid copying known request fields

---------

Signed-off-by: Akshay Deo <akshay@akshaydeo.com>
Co-authored-by: jeremym-tanium <jeremy.maness@tanium.com>
Co-authored-by: Akshay Deo <akshay@akshaydeo.com>
Co-authored-by: Madhu Shantan <madhushantangot@gmail.com>
Co-authored-by: CMWR421 <182079927+CMWR421@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
atharvamhaske pushed a commit to atharvamhaske/bifrost that referenced this pull request Aug 13, 2026
## Summary

Resolves merge conflicts in `core/go.sum` that were left over from merging the path normalization auth bypass fix (maximhq#5763).

## Changes

- Removed leftover `<<<<<<< HEAD`, `=======`, and `>>>>>>> e0057ff` conflict markers from `core/go.sum`
- Retained the correct `go.mod` hash lines for `aws-sdk-go-v2/config`, `aws-sdk-go-v2/internal/ini`, and `aws-sdk-go-v2/service/s3` that were dropped during the conflict

## Type of change

- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [x] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

```sh
cd core
go mod verify
go test ./...
```

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

Closes maximhq#5763

## Security considerations

No security implications. This is a cleanup of unresolved merge conflict markers in the dependency lockfile.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
atharvamhaske pushed a commit to atharvamhaske/bifrost that referenced this pull request Aug 13, 2026
## Summary

Resolves merge conflicts in `core/go.sum` that were left over from merging the path normalization auth bypass fix (maximhq#5763).

## Changes

- Removed leftover `<<<<<<< HEAD`, `=======`, and `>>>>>>> e0057ff` conflict markers from `core/go.sum`
- Retained the correct `go.mod` hash lines for `aws-sdk-go-v2/config`, `aws-sdk-go-v2/internal/ini`, and `aws-sdk-go-v2/service/s3` that were dropped during the conflict

## Type of change

- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [x] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

```sh
cd core
go mod verify
go test ./...
```

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

Closes maximhq#5763

## Security considerations

No security implications. This is a cleanup of unresolved merge conflict markers in the dependency lockfile.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
akshaydeo added a commit that referenced this pull request Aug 13, 2026
Loading a custom plugin `path` causes native code (a `.so`) to be `dlopen()`'d directly into the gateway process. Previously, this was allowed even when dashboard authentication was disabled or unconfigured — meaning any caller who could reach the management API could inject arbitrary native code. This PR closes that gap by requiring a genuinely authenticated admin session for any create or update operation that sets a non-builtin plugin `path`, and separately hardens the plugin downloader against SSRF.

- Added `BifrostContextKeyAuthBypassed` context key, set by the auth middleware exclusively when a request is let through because dashboard auth is disabled/unconfigured (distinct from `IsLocalAdminContextKey`, which is also set on real authenticated sessions).
- `createPlugin` and `updatePlugin` handlers now check `BifrostContextKeyAuthBypassed` and return `403` before any DB write when a non-builtin `path` is supplied without genuine authentication.
- Replaced the `fasthttp`-based plugin downloader with a `net/http` client backed by `network.SSRFSafeDialContext`, matching the SSRF hardening already applied to `core/providers/utils.FetchAndEncodeURL`. The new client: rejects non-`http`/`https` schemes before any network call, refuses connections to loopback, private, CGNAT, link-local, and unspecified addresses (including IPv4-in-IPv6 transition addresses) at dial time (not just DNS lookup time, so DNS rebinding doesn't bypass it), applies the same IP check to redirect targets, caps redirect depth at 5, and limits response body reads to 200 MB.
- Tests for `DownloadPlugin` now use a `useNonSSRFGuardedClient` helper that swaps in a plain dialer for the duration of each test (since `httptest` servers bind to loopback, which the production dialer correctly blocks). A new `TestDownloadPlugin_BlocksSSRFToLoopback` test verifies the production guard is active by default, and `TestDownloadPlugin_RejectsNonHTTPScheme` verifies `file://` and similar schemes are rejected before any network call.
- New handler tests cover all four cases: create with bypassed auth (expect 403, no DB write), create with real auth (expect 201, path stored), update with bypassed auth (expect 403, no DB write), and the existing config-merge behaviour.
- OpenAPI docs and the plugin sequencing guide updated to document the 403 response and the authentication requirement for `path`.
- Dependency bumps: `aws-sdk-go-v2/config` → v1.32.14, `aws-sdk-go-v2/service/s3` → v1.99.0, `aws-sdk-go-v2/internal/ini` → v1.8.6, `buger/jsonparser` → v1.2.0.

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [x] Chore/CI

> This is primarily a security hardening change.

- [x] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [x] Plugins
- [ ] UI (React)
- [x] Docs

```sh
go test ./...

go test ./transports/bifrost-http/handlers/... -run TestCreatePlugin_RejectsCustomPathWhenAuthBypassed
go test ./transports/bifrost-http/handlers/... -run TestCreatePlugin_AllowsCustomPathWhenNotBypassed
go test ./transports/bifrost-http/handlers/... -run TestUpdatePlugin_RejectsCustomPathWhenAuthBypassed

go test ./framework/plugins/... -run TestDownloadPlugin_BlocksSSRFToLoopback
go test ./framework/plugins/... -run TestDownloadPlugin_RejectsNonHTTPScheme
```

To manually verify the 403 behaviour: start the gateway with no dashboard auth configured, then attempt `POST /api/plugins` with a `path` field pointing to a `.so`. The response should be `403` with a message instructing the operator to enable dashboard authentication first.

- [x] Yes
- [ ] No

Operators running with dashboard authentication disabled who were previously able to create or update custom plugin paths via the API will now receive a `403`. To restore the capability, enable dashboard authentication and authenticate before calling those endpoints.

- Closes an unauthenticated native code injection vector: without this change, any network-reachable caller could `dlopen()` an attacker-controlled `.so` into the gateway process when dashboard auth was off.
- The SSRF fix on the plugin downloader prevents a crafted plugin URL from causing the gateway to fetch from internal/metadata endpoints (e.g. cloud IMDS). The guard runs at dial time, not DNS resolution time, so DNS rebinding attacks do not bypass it.
- `BifrostContextKeyAuthBypassed` is intentionally separate from `IsLocalAdminContextKey` so that future handlers gating other high-risk operations can use the same signal without ambiguity.

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable
akshaydeo added a commit that referenced this pull request Aug 13, 2026
## Summary

Resolves merge conflicts in `core/go.sum` that were left over from merging the path normalization auth bypass fix (#5763).

## Changes

- Removed leftover `<<<<<<< HEAD`, `=======`, and `>>>>>>> e0057ff` conflict markers from `core/go.sum`
- Retained the correct `go.mod` hash lines for `aws-sdk-go-v2/config`, `aws-sdk-go-v2/internal/ini`, and `aws-sdk-go-v2/service/s3` that were dropped during the conflict

## Type of change

- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [x] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

```sh
cd core
go mod verify
go test ./...
```

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

Closes #5763

## Security considerations

No security implications. This is a cleanup of unresolved merge conflict markers in the dependency lockfile.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
akshaydeo added a commit that referenced this pull request Aug 13, 2026
Loading a custom plugin `path` causes native code (a `.so`) to be `dlopen()`'d directly into the gateway process. Previously, this was allowed even when dashboard authentication was disabled or unconfigured — meaning any caller who could reach the management API could inject arbitrary native code. This PR closes that gap by requiring a genuinely authenticated admin session for any create or update operation that sets a non-builtin plugin `path`, and separately hardens the plugin downloader against SSRF.

- Added `BifrostContextKeyAuthBypassed` context key, set by the auth middleware exclusively when a request is let through because dashboard auth is disabled/unconfigured (distinct from `IsLocalAdminContextKey`, which is also set on real authenticated sessions).
- `createPlugin` and `updatePlugin` handlers now check `BifrostContextKeyAuthBypassed` and return `403` before any DB write when a non-builtin `path` is supplied without genuine authentication.
- Replaced the `fasthttp`-based plugin downloader with a `net/http` client backed by `network.SSRFSafeDialContext`, matching the SSRF hardening already applied to `core/providers/utils.FetchAndEncodeURL`. The new client: rejects non-`http`/`https` schemes before any network call, refuses connections to loopback, private, CGNAT, link-local, and unspecified addresses (including IPv4-in-IPv6 transition addresses) at dial time (not just DNS lookup time, so DNS rebinding doesn't bypass it), applies the same IP check to redirect targets, caps redirect depth at 5, and limits response body reads to 200 MB.
- Tests for `DownloadPlugin` now use a `useNonSSRFGuardedClient` helper that swaps in a plain dialer for the duration of each test (since `httptest` servers bind to loopback, which the production dialer correctly blocks). A new `TestDownloadPlugin_BlocksSSRFToLoopback` test verifies the production guard is active by default, and `TestDownloadPlugin_RejectsNonHTTPScheme` verifies `file://` and similar schemes are rejected before any network call.
- New handler tests cover all four cases: create with bypassed auth (expect 403, no DB write), create with real auth (expect 201, path stored), update with bypassed auth (expect 403, no DB write), and the existing config-merge behaviour.
- OpenAPI docs and the plugin sequencing guide updated to document the 403 response and the authentication requirement for `path`.
- Dependency bumps: `aws-sdk-go-v2/config` → v1.32.14, `aws-sdk-go-v2/service/s3` → v1.99.0, `aws-sdk-go-v2/internal/ini` → v1.8.6, `buger/jsonparser` → v1.2.0.

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [x] Chore/CI

> This is primarily a security hardening change.

- [x] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [x] Plugins
- [ ] UI (React)
- [x] Docs

```sh
go test ./...

go test ./transports/bifrost-http/handlers/... -run TestCreatePlugin_RejectsCustomPathWhenAuthBypassed
go test ./transports/bifrost-http/handlers/... -run TestCreatePlugin_AllowsCustomPathWhenNotBypassed
go test ./transports/bifrost-http/handlers/... -run TestUpdatePlugin_RejectsCustomPathWhenAuthBypassed

go test ./framework/plugins/... -run TestDownloadPlugin_BlocksSSRFToLoopback
go test ./framework/plugins/... -run TestDownloadPlugin_RejectsNonHTTPScheme
```

To manually verify the 403 behaviour: start the gateway with no dashboard auth configured, then attempt `POST /api/plugins` with a `path` field pointing to a `.so`. The response should be `403` with a message instructing the operator to enable dashboard authentication first.

- [x] Yes
- [ ] No

Operators running with dashboard authentication disabled who were previously able to create or update custom plugin paths via the API will now receive a `403`. To restore the capability, enable dashboard authentication and authenticate before calling those endpoints.

- Closes an unauthenticated native code injection vector: without this change, any network-reachable caller could `dlopen()` an attacker-controlled `.so` into the gateway process when dashboard auth was off.
- The SSRF fix on the plugin downloader prevents a crafted plugin URL from causing the gateway to fetch from internal/metadata endpoints (e.g. cloud IMDS). The guard runs at dial time, not DNS resolution time, so DNS rebinding attacks do not bypass it.
- `BifrostContextKeyAuthBypassed` is intentionally separate from `IsLocalAdminContextKey` so that future handlers gating other high-risk operations can use the same signal without ambiguity.

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable
akshaydeo added a commit that referenced this pull request Aug 13, 2026
## Summary

Resolves merge conflicts in `core/go.sum` that were left over from merging the path normalization auth bypass fix (#5763).

## Changes

- Removed leftover `<<<<<<< HEAD`, `=======`, and `>>>>>>> e0057ff` conflict markers from `core/go.sum`
- Retained the correct `go.mod` hash lines for `aws-sdk-go-v2/config`, `aws-sdk-go-v2/internal/ini`, and `aws-sdk-go-v2/service/s3` that were dropped during the conflict

## Type of change

- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [x] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

```sh
cd core
go mod verify
go test ./...
```

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

Closes #5763

## Security considerations

No security implications. This is a cleanup of unresolved merge conflict markers in the dependency lockfile.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
@akshaydeo akshaydeo mentioned this pull request Aug 13, 2026
akshaydeo added a commit that referenced this pull request Aug 13, 2026
## ✨ Features

- **MCP Per-User OAuth** - MCP clients can hold per-user OAuth
credentials and per-user headers, configurable from `config.json` as
well as the UI, with a documented shared vs per-identity token lookup
contract and VK/Users filters on the OAuth Grants and MCP Auth Sessions
sidebars
- **Token Exchange IDP Credentials** - New `use_idp_credentials` on
`token_exchange` reuses SSO login app credentials for providers that
require it, such as Microsoft Entra ID; `client_id` becomes optional
when it is set (#6068, #6069)
- **Bedrock VPC Endpoints** - AWS Bedrock keys can target VPC endpoints
(#6064)
- **Per-Request Flat-Fee Pricing** - New `cost_per_request` field flows
through datasheet sync, the cost engine, custom overrides and the UI
override form (#6079)
- **Pricing Overrides in the Model Catalog** - `/api/models/details`
exposes resolved pricing overrides, and catalog rows resolve overrides
server-side (#6055, #6056)
- **MCP Tool Discovery Persistence** - Discovered MCP tools persist and
resync uniformly across all client types through a hash-gated core
callback, surviving restarts and propagating across a cluster
- **W3C Trace ID Propagation** - Requests carry a W3C trace ID on the
context (#5945)
- **Cancellable Log Cost Recalculation** - Log cost recalculation tasks
can be cancelled from the backend (#5801)
- **Separate OTEL Metrics Pipeline** - The OTEL collector supports a
metrics tab independent of traces, plus separate headers for traces and
metrics (#5939, #5940)
- **Roots-Only Log Filter** - New `roots_only` filter collapses fallback
chains into their root entry with child aggregates (#5737)
- **MCP Log Redaction and Plugin Logs** - MCP tool logs carry redaction
mappings and plugin logs (#5744, #5746)
- **User Agent and App Attribution in Logs** - Logs and MCP tool logs
record user agent, app, source, decision, app key and device ID
- **S3 Log Export Metadata** - Additional metadata is written alongside
S3 log exports (#6070)
- **Matview Maintenance Off Switch** - `matview_refresh_interval`
accepts `"off"` to disable logstore matview maintenance entirely (thanks
[@jeremym-tanium](https://github.com/jeremym-tanium)!) (#5693)
- **Video Request Info in Logs UI** - Video requests surface their
details in the logs UI (#5946)
- **Shell Rewriter Hook** - The UI handler exposes a `ShellRewriter`
hook for pre-hydration HTML rewriting (#5807)
- **Auth Skip Path** - Adds a context path letting trusted internal
callers bypass auth resolution

## 🐞 Fixed

- **Path Normalization Auth Bypass** - Fixed a path normalization flaw
that allowed auth to be bypassed (#5763)
- **Minimal Reasoning Effort on GPT-5 Models** - `reasoning_effort:
"minimal"` is preserved for GPT-5-family OpenAI models instead of being
downgraded to `low` (thanks [@jitokim](https://github.com/jitokim)!)
(#6046)
- **Gemini Truncated Response Finish Reason** - Truncated Gemini
responses report `MAX_TOKENS` instead of `OTHER` (thanks
[@AdityaPainuli](https://github.com/AdityaPainuli)!) (#5979)
- **Null Tool-Call Function Name on Streaming** - Streaming continuation
deltas no longer materialize an absent tool-call function name as `null`
(thanks [@AdityaPainuli](https://github.com/AdityaPainuli)!) (#5966)
- **Bedrock Document Uploads** - Fixed Bedrock file handling in
inference so office and PDF documents sent as OpenAI `type: "file"` are
accepted (#5947)
- **xAI Usage Cost** - Fixed USD cost ticks for xAI usage (#5950)
- **Anthropic Encrypted Reasoning** - Added an Anthropic error branch
when stripping encrypted reasoning content
- **MCP Reconnect and Lock Ordering** - Broke a lock-order inversion in
`ConnectionCheckerManager`, rebuilt ephemeral clients across the whole
connect+init retry, preserved last-known tool maps across close-first
reconnects, bound connect attempts to entry identity, deduped background
reconnects and gated SSE `OnConnectionLost` on connection identity
- **MCP OAuth Session Correctness** - Restricted `Reauthorize` to shared
OAuth clients, rejected inactive tokens in `ValidateToken`, made the
OAuth flow claim atomic against concurrent reauth, stopped dropping
stored scopes on decode failure, and closed a verify-headers
double-submit race that also dropped TLS, timeout and per-user-header
fields
- **Session Stickiness Reconciliation** - `needs_session_stickiness` is
pinned across `config.json` reconciliation, so an unrelated file edit
can no longer silently revert a client to per-call
- **Credential Cache Cancellation** - `headerCredentialCache.Fill` and
`userTokenCache.Fill` propagate context so a cancelled request unblocks
instead of waiting on an unrelated leader; LRU entries carry a version
so a rejected stale `Get` cannot evict a concurrently-updated value
- **Governance List-Models Call** - Budgets and rate limits no longer
trigger a list-models call (#6051)
- **Realtime Response Create Input** - Guarded `response.create` input
(#6050)
- **HTTP Server Timeouts** - Configured bounded `http.Server` timeouts
and a request-body limit
- **MCP Client State Badges** - State badges render with spaces instead
of underscores, and the state filter bucket was renamed from
`disconnected` to `unstable`
- **Entra OBO Scope** - `offline_access` is combined with
`<audience>/.default` for Entra OBO instead of replacing it (#6078)

## 🔧 Maintenance

- **Governance Route Families** - Editions can override governance route
families (#5839)
- **Dependency Upgrades** - Dependabot updates across all modules, plus
module path fixes (#6040, #5864)
- **Documentation** - config.schema.json doc fixes and Datadog env var
reference fixes in the helm chart docs (#5938, #6019)

## 🗄️ Database Migrations

**configstore:**

- **add_mcp_client_pending_oauth_config_json_column** - Adds
`pending_oauth_config_json` to `config_mcp_clients`. Reversible: drops
the added column.
- **merge_oauth_token_tables** - Consolidates `oauth_tokens` and
`oauth_user_tokens` into `mcp_oauth_tokens`. **Non-reversible**:
rollback deliberately leaves `mcp_oauth_tokens` in place, because every
OAuth read and write targets it from this migration onward and dropping
it would destroy any token created or refreshed since, forcing every
holder to re-authorize.
- **create_mcp_oauth_flows_table** - Creates `mcp_oauth_flows` to track
in-flight OAuth flows. Reversible: drops the new table.
- **drop_oauth_config_pkce_columns** - Drops CSRF state, PKCE verifier
and `expires_at` from the OAuth config table now that they live on
`mcp_oauth_flows`. **Non-reversible**: forward-only, the dropped values
were per-flow ephemeral and re-adding empty columns would restore
nothing.
- **drop_oauth_config_token_id_column** - Drops `token_id`.
**Non-reversible**: forward-only, it was a pure FK shortcut now
reachable via `(oauth_config_id, auth_mode)`.
- **add_mcp_admin_auth_mode_indexes** - Adds admin partial unique
indexes on `mcp_oauth_tokens` and `mcp_per_user_header_credentials`.
Reversible: drops both indexes.
- **add_mcp_client_token_exchange_json_column** - Adds
`token_exchange_json` to `config_mcp_clients`. Reversible: drops the
added column.
- **add_needs_session_stickiness_column** - Adds
`needs_session_stickiness` to `config_mcp_clients`. Reversible: drops
the added column.
- **add_bedrock_endpoints_columns** - Adds Bedrock VPC endpoint columns
to the keys table. Reversible: drops the added columns.
- **add_cost_per_request_pricing_column** - Adds `cost_per_request` to
model pricing. Reversible: drops the added column.

**logstore:**

- **logs_add_guardrail_debug_column** - Adds `guardrail_debug` to logs.
Reversible: drops the added column.
- **mcp_tool_logs_add_redaction_mapping_column** - Adds the redaction
mapping column to MCP tool logs. **Non-reversible**: rollback is a no-op
because dropping the column would permanently destroy reveal data for
already-redacted MCP logs.
- **logs_add_user_agent_column** - Adds user agent and app columns,
their indexes, and a `UserAgentMapping` table. Reversible: drops the
indexes and the mapping table.
- **mcp_tool_logs_add_user_agent_column** - Adds user agent and app
columns plus indexes to MCP tool logs. Reversible: drops both indexes
and the `app` column.
- **mcp_tool_logs_add_endpoint_columns** - Adds `source`, `decision`,
`app_key` and `device_id` to MCP tool logs. Reversible: drops all four
columns.
- **mcp_tool_logs_add_plugin_logs_column** - Adds `plugin_logs` to MCP
tool logs. Reversible: drops the added column.
- **logs_recreate_matviews_with_user_agent_column** and
**logs_recreate_matviews_with_app_column** - Recreate the log
materialized views to include the new columns. Rollback is a no-op
because `ensureMatViews` recreates them on next startup.

<Warning>
**High-throughput deployments: run the logstore migrations during a
low-activity window.**

Every logstore migration above alters `logs` or `mcp_tool_logs`, the two
highest-insert tables in Bifrost, and several also build indexes on
them. On a busy instance the index builds hold locks that block
concurrent log inserts for the duration of the build, and the matview
recreations rebuild against the full table. Schedule the upgrade for a
low-traffic period, or expect elevated log-write latency and possible
request-path backpressure while the migrations run.
</Warning>

<Warning>
`merge_oauth_token_tables`, `drop_oauth_config_pkce_columns` and
`drop_oauth_config_token_id_column` transform or remove existing OAuth
state and cannot be rolled back. Take a database backup before
upgrading, and do not roll the binary back past this release once the
migration has run.
</Warning>

## 🐙 Closed GitHub Issues

- [#123](#123) - Files API
Support
- [#5472](#5472) - [Bug]:
Bedrock rejects office/PDF document uploads via OpenAI `type:"file"` -
"The PDF specified was not valid"
- [#5900](#5900) - [Bug]:
Streaming continuation chunks materialize omitted tool-call metadata as
null
- [#5978](#5978) - [Bug]:
Gemini egress reports truncated responses as FinishReason OTHER,
IncompleteDetails switch matches a string that never occurs
- [#6044](#6044) - [Bug]:
normalizeOpenAIReasoningEffort maps 'minimal' to 'low' for ALL OpenAI
models, even ones that natively support 'minimal'
akshaydeo added a commit that referenced this pull request Aug 14, 2026
Loading a custom plugin `path` causes native code (a `.so`) to be `dlopen()`'d directly into the gateway process. Previously, this was allowed even when dashboard authentication was disabled or unconfigured — meaning any caller who could reach the management API could inject arbitrary native code. This PR closes that gap by requiring a genuinely authenticated admin session for any create or update operation that sets a non-builtin plugin `path`, and separately hardens the plugin downloader against SSRF.

- Added `BifrostContextKeyAuthBypassed` context key, set by the auth middleware exclusively when a request is let through because dashboard auth is disabled/unconfigured (distinct from `IsLocalAdminContextKey`, which is also set on real authenticated sessions).
- `createPlugin` and `updatePlugin` handlers now check `BifrostContextKeyAuthBypassed` and return `403` before any DB write when a non-builtin `path` is supplied without genuine authentication.
- Replaced the `fasthttp`-based plugin downloader with a `net/http` client backed by `network.SSRFSafeDialContext`, matching the SSRF hardening already applied to `core/providers/utils.FetchAndEncodeURL`. The new client: rejects non-`http`/`https` schemes before any network call, refuses connections to loopback, private, CGNAT, link-local, and unspecified addresses (including IPv4-in-IPv6 transition addresses) at dial time (not just DNS lookup time, so DNS rebinding doesn't bypass it), applies the same IP check to redirect targets, caps redirect depth at 5, and limits response body reads to 200 MB.
- Tests for `DownloadPlugin` now use a `useNonSSRFGuardedClient` helper that swaps in a plain dialer for the duration of each test (since `httptest` servers bind to loopback, which the production dialer correctly blocks). A new `TestDownloadPlugin_BlocksSSRFToLoopback` test verifies the production guard is active by default, and `TestDownloadPlugin_RejectsNonHTTPScheme` verifies `file://` and similar schemes are rejected before any network call.
- New handler tests cover all four cases: create with bypassed auth (expect 403, no DB write), create with real auth (expect 201, path stored), update with bypassed auth (expect 403, no DB write), and the existing config-merge behaviour.
- OpenAPI docs and the plugin sequencing guide updated to document the 403 response and the authentication requirement for `path`.
- Dependency bumps: `aws-sdk-go-v2/config` → v1.32.14, `aws-sdk-go-v2/service/s3` → v1.99.0, `aws-sdk-go-v2/internal/ini` → v1.8.6, `buger/jsonparser` → v1.2.0.

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [x] Chore/CI

> This is primarily a security hardening change.

- [x] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [x] Plugins
- [ ] UI (React)
- [x] Docs

```sh
go test ./...

go test ./transports/bifrost-http/handlers/... -run TestCreatePlugin_RejectsCustomPathWhenAuthBypassed
go test ./transports/bifrost-http/handlers/... -run TestCreatePlugin_AllowsCustomPathWhenNotBypassed
go test ./transports/bifrost-http/handlers/... -run TestUpdatePlugin_RejectsCustomPathWhenAuthBypassed

go test ./framework/plugins/... -run TestDownloadPlugin_BlocksSSRFToLoopback
go test ./framework/plugins/... -run TestDownloadPlugin_RejectsNonHTTPScheme
```

To manually verify the 403 behaviour: start the gateway with no dashboard auth configured, then attempt `POST /api/plugins` with a `path` field pointing to a `.so`. The response should be `403` with a message instructing the operator to enable dashboard authentication first.

- [x] Yes
- [ ] No

Operators running with dashboard authentication disabled who were previously able to create or update custom plugin paths via the API will now receive a `403`. To restore the capability, enable dashboard authentication and authenticate before calling those endpoints.

- Closes an unauthenticated native code injection vector: without this change, any network-reachable caller could `dlopen()` an attacker-controlled `.so` into the gateway process when dashboard auth was off.
- The SSRF fix on the plugin downloader prevents a crafted plugin URL from causing the gateway to fetch from internal/metadata endpoints (e.g. cloud IMDS). The guard runs at dial time, not DNS resolution time, so DNS rebinding attacks do not bypass it.
- `BifrostContextKeyAuthBypassed` is intentionally separate from `IsLocalAdminContextKey` so that future handlers gating other high-risk operations can use the same signal without ambiguity.

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable
akshaydeo added a commit that referenced this pull request Aug 14, 2026
## Summary

Resolves merge conflicts in `core/go.sum` that were left over from merging the path normalization auth bypass fix (#5763).

## Changes

- Removed leftover `<<<<<<< HEAD`, `=======`, and `>>>>>>> e0057ff` conflict markers from `core/go.sum`
- Retained the correct `go.mod` hash lines for `aws-sdk-go-v2/config`, `aws-sdk-go-v2/internal/ini`, and `aws-sdk-go-v2/service/s3` that were dropped during the conflict

## Type of change

- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [x] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

```sh
cd core
go mod verify
go test ./...
```

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

Closes #5763

## Security considerations

No security implications. This is a cleanup of unresolved merge conflict markers in the dependency lockfile.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
akshaydeo added a commit that referenced this pull request Aug 19, 2026
Loading a custom plugin `path` causes native code (a `.so`) to be `dlopen()`'d directly into the gateway process. Previously, this was allowed even when dashboard authentication was disabled or unconfigured — meaning any caller who could reach the management API could inject arbitrary native code. This PR closes that gap by requiring a genuinely authenticated admin session for any create or update operation that sets a non-builtin plugin `path`, and separately hardens the plugin downloader against SSRF.

- Added `BifrostContextKeyAuthBypassed` context key, set by the auth middleware exclusively when a request is let through because dashboard auth is disabled/unconfigured (distinct from `IsLocalAdminContextKey`, which is also set on real authenticated sessions).
- `createPlugin` and `updatePlugin` handlers now check `BifrostContextKeyAuthBypassed` and return `403` before any DB write when a non-builtin `path` is supplied without genuine authentication.
- Replaced the `fasthttp`-based plugin downloader with a `net/http` client backed by `network.SSRFSafeDialContext`, matching the SSRF hardening already applied to `core/providers/utils.FetchAndEncodeURL`. The new client: rejects non-`http`/`https` schemes before any network call, refuses connections to loopback, private, CGNAT, link-local, and unspecified addresses (including IPv4-in-IPv6 transition addresses) at dial time (not just DNS lookup time, so DNS rebinding doesn't bypass it), applies the same IP check to redirect targets, caps redirect depth at 5, and limits response body reads to 200 MB.
- Tests for `DownloadPlugin` now use a `useNonSSRFGuardedClient` helper that swaps in a plain dialer for the duration of each test (since `httptest` servers bind to loopback, which the production dialer correctly blocks). A new `TestDownloadPlugin_BlocksSSRFToLoopback` test verifies the production guard is active by default, and `TestDownloadPlugin_RejectsNonHTTPScheme` verifies `file://` and similar schemes are rejected before any network call.
- New handler tests cover all four cases: create with bypassed auth (expect 403, no DB write), create with real auth (expect 201, path stored), update with bypassed auth (expect 403, no DB write), and the existing config-merge behaviour.
- OpenAPI docs and the plugin sequencing guide updated to document the 403 response and the authentication requirement for `path`.
- Dependency bumps: `aws-sdk-go-v2/config` → v1.32.14, `aws-sdk-go-v2/service/s3` → v1.99.0, `aws-sdk-go-v2/internal/ini` → v1.8.6, `buger/jsonparser` → v1.2.0.

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [x] Chore/CI

> This is primarily a security hardening change.

- [x] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [x] Plugins
- [ ] UI (React)
- [x] Docs

```sh
go test ./...

go test ./transports/bifrost-http/handlers/... -run TestCreatePlugin_RejectsCustomPathWhenAuthBypassed
go test ./transports/bifrost-http/handlers/... -run TestCreatePlugin_AllowsCustomPathWhenNotBypassed
go test ./transports/bifrost-http/handlers/... -run TestUpdatePlugin_RejectsCustomPathWhenAuthBypassed

go test ./framework/plugins/... -run TestDownloadPlugin_BlocksSSRFToLoopback
go test ./framework/plugins/... -run TestDownloadPlugin_RejectsNonHTTPScheme
```

To manually verify the 403 behaviour: start the gateway with no dashboard auth configured, then attempt `POST /api/plugins` with a `path` field pointing to a `.so`. The response should be `403` with a message instructing the operator to enable dashboard authentication first.

- [x] Yes
- [ ] No

Operators running with dashboard authentication disabled who were previously able to create or update custom plugin paths via the API will now receive a `403`. To restore the capability, enable dashboard authentication and authenticate before calling those endpoints.

- Closes an unauthenticated native code injection vector: without this change, any network-reachable caller could `dlopen()` an attacker-controlled `.so` into the gateway process when dashboard auth was off.
- The SSRF fix on the plugin downloader prevents a crafted plugin URL from causing the gateway to fetch from internal/metadata endpoints (e.g. cloud IMDS). The guard runs at dial time, not DNS resolution time, so DNS rebinding attacks do not bypass it.
- `BifrostContextKeyAuthBypassed` is intentionally separate from `IsLocalAdminContextKey` so that future handlers gating other high-risk operations can use the same signal without ambiguity.

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable
akshaydeo added a commit that referenced this pull request Aug 19, 2026
## Summary

Resolves merge conflicts in `core/go.sum` that were left over from merging the path normalization auth bypass fix (#5763).

## Changes

- Removed leftover `<<<<<<< HEAD`, `=======`, and `>>>>>>> e0057ff` conflict markers from `core/go.sum`
- Retained the correct `go.mod` hash lines for `aws-sdk-go-v2/config`, `aws-sdk-go-v2/internal/ini`, and `aws-sdk-go-v2/service/s3` that were dropped during the conflict

## Type of change

- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [x] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

```sh
cd core
go mod verify
go test ./...
```

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

Closes #5763

## Security considerations

No security implications. This is a cleanup of unresolved merge conflict markers in the dependency lockfile.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
@akshaydeo akshaydeo mentioned this pull request Aug 26, 2026
akshaydeo added a commit that referenced this pull request Aug 26, 2026
<Note>
v2.0.0 is the first stable release on the 2.0 line. This changelog rolls
up `2.0.0-prerelease1` (based on
[v1.6.3](https://docs.getbifrost.ai/changelogs/v1.6.3)),
`2.0.0-prerelease2`, `2.0.0-prerelease3` and the final release window,
so it is the complete delta for a deployment upgrading from any v1.6.x
release. Fixes that also shipped on the v1.6.x line after v1.6.3 are
listed once here.
</Note>

<Warning>
**Breaking changes.** Read the [v2.0.0 migration
guide](https://docs.getbifrost.ai/migration-guides/v2.0.0) before
upgrading.

- **Custom plugin downloads are SSRF-protected** - a plugin `path`
pointing at an http(s) URL is rejected if it resolves to a loopback,
private, CGNAT, link-local or otherwise non-public address, and every
custom plugin path is re-verified on each restart, including ones
defined in `config.json`.
- **Custom plugin create and update require admin authentication** -
`POST /api/plugins` and `PUT /api/plugins/{name}` reject a custom `path`
when the caller only got through because dashboard auth is disabled or
unconfigured.
- **Governance APIs moved under `/api/governance/*`** - `/api/teams`,
`/api/users`, `/api/roles`, `/api/audit-logs` and other top-level
governance paths moved under one namespace; Team and User lists use
`limit`/`offset` pagination. Routing rules and the complexity analyzer
moved from `/api/governance/*` to `/api/routing/rules` and
`/api/routing/complexity-analyzer-config`; the old paths remain as
deprecated aliases.
- **`HTTPTransportPreHook` now runs after authentication** - the
pipeline is `HTTPTransportPreAuthHook -> auth -> HTTPTransportPreHook ->
handler`. Plugins that inject a credential (`x-bf-vk`, `Authorization`,
`x-api-key`) must move that work to the new `HTTPTransportPreAuthHook`,
and Go plugins implementing `HTTPTransportPlugin` must add the method
(`.so` plugins that predate it are skipped for that phase).
- **Legacy telemetry attributes removed** - the `gen_ai.*`-namespaced
Bifrost-internal span attributes,
`gen_ai.usage.prompt_tokens`/`completion_tokens`, the nanosecond
`time_to_first_token` attribute and `x-bf-prom-*` request-header
Prometheus dimensions are gone from the OTel and Prometheus connectors.
Dashboards should read the `bifrost.*` keys and `time_to_first_chunk`.
- **Gemini tool preference** - a Gemini API request carrying both
function declarations and Google Search without
`include_server_side_tool_invocations` now keeps the function
declarations and drops Google Search (previously the opposite). Set
`include_server_side_tool_invocations: true` to send both on Gemini 3
models. Vertex is unaffected.
</Warning>

## ✨ Features

- **Batch Accounting** - Provider batch jobs are tracked in a new
`batch_jobs` table and settled asynchronously: results are priced per
model from catalog batch rates (0.5 default ratio) on the `/results`
path, one aggregate cost log is written idempotently with the creating
request's identity, a background sweeper with ownership fencing
re-drives jobs that timed out, settled usage is charged exactly once to
the creating user's budgets and rate limits (including unscoped virtual
key budgets on model-less batch-create requests), mixed-model batch rows
are repriced during cost recalculation, and the log detail view shows a
Batch Details block with per-state request counts and the settled cost
(#5291, #5292, #5293, #5294, #5295, #5296, #6109, #6121, #6376, #6410,
#6474, #6505)
- **Claude-on-Vertex Batches** - Vertex batch jobs route Anthropic
models to `publishers/anthropic/...`, build Claude-on-Vertex JSONL
instances, round-trip `custom_id`, and preserve `tools`, `toolConfig`,
`cachedContent`, `labels` and `display_name` on Gemini/Vertex batch
requests (#5368)
- **Input / Output Cost Split** - Every log carries `input_cost`,
`output_cost` and `additional_cost` (guardrails, semantic cache, MCP)
next to the total, across the RDB, ClickHouse, matviews, recalculation
and the quota API; speech, transcription and OCR usages carry
`BifrostCost`; the log detail view shows the split with per-category
detail (#6511)
- **Bifrost Overhead Latency** - `upstream_latency` and
`overhead_latency` are recorded on every log, aggregated (avg, p90, p95,
p99) in the dashboard's new Bifrost Overhead chart and shown in the log
detail view; the overhead is decomposed by span self-time into
serialization, conversion, plugins, middleware, key selection, queue
wait, networking, client delivery and scheduling buckets (including
streaming per-chunk parse, conversion and backpressure and the worker
hand-off), persisted to `overhead_breakdown` and rendered as a stacked
bar in the log detail view; a `bifrost_overhead_latency_microseconds`
histogram is exported to Prometheus and OpenTelemetry and
`upstream_latency_ms`/`overhead_latency_ms` tags to Maxim, while
breakdown spans are kept out of observability connectors (#5533, #5534,
#5535, #6345, #6388, #6389, #6433, #6470, #6495)
- **Notification Center** - Role-targeted dashboard notifications stored
in the database, delivered over WebSocket and surfaced in a topbar tray
via `GET/POST /api/notifications` (#6207, #6227, #6324)
- **Topbar and Responsive Dashboard** - Persistent topbar with page
titles, theme toggle, external links, user menu and version; responsive
layouts across all views with truncation and tooltips for long values
and icon-only buttons; version-skew detection with an auto-reloading
upgrading screen (#6196, #6105, #6126, #6204, #6232, #6330, #6370,
#6476, #6485, #6493)
- **Video Edits** - `POST /v1/videos/edits` applies prompt-driven edits,
upscaling and background removal to an existing video supplied as bytes,
a URL or a provider video ID, on OpenAI and Runware (#6270)
- **Runware Chat, Catalog and Media Operations** - Chat completions,
streaming and Responses via Runware's OpenAI-compatible endpoint,
`ListModels` from the curated catalog, image upscale via
`/v1/images/edits` (`type=upscale`), image-to-3D and async 3D generation
via `/v1/videos` (`type=3d`), provider-reported per-task cost, and a raw
`/runware_passthrough` route (#6260, #6372, #6208, #6075)
- **JSON Image Edits** - `POST /v1/images/edits` accepts JSON bodies
with URL or base64 images and typed extra params in addition to
multipart (#6418)
- **OpenAI Ultrafast Service Tier** - `service_tier: "ultrafast"` is
forwarded only to models that support it and billed at dedicated
ultrafast rates, with matching custom pricing override fields (#6396,
#6399)
- **Service Tier on Logs** - Logs record the tier actually served,
including Anthropic's `service_tier` from `message_start` on streams,
with a Service Tier column and detail field so repricing uses the served
tier (#6233, #6236)
- **Pricing Fields** - New per-request flat fee (`cost_per_request`),
megapixel-based image tiers (4/8/16/32/64 MP), per-size and joint
size+quality image rates for `gpt-image-1`-style models, and
`input_cost_per_query` for rerank flow through datasheet sync, the cost
engine, custom overrides, the API and the UI override form; upscale
output resolution is backfilled from `target`/`factor` on Replicate so
tiered rates bill the real output size (#6079, #6082, #6083, #6379,
#6380)
- **Model Catalog Pricing and Overrides** - Pricing data in the model
catalog (thanks [@johnbrett](https://github.com/johnbrett)!), with
resolved pricing overrides exposed on `/api/models/details` and on
catalog rows, shown in the dashboard (#6055, #6056, #6058)
- **Typed Embeddings on Bedrock** - Titan V2 `embeddingTypes` and Cohere
`embedding_types` on Converse, the native invoke route and LangChain
`BedrockEmbeddings` (#6381)
- **Rerank Upgrades** - Structured JSON documents, `return_documents`,
`next_token` pagination, caller document IDs preserved in every result,
Cohere-shaped errors, cross-provider responses converted back to the
caller's wire shape, and `/genai/v1/rank` served cross-provider (#6328,
#6301, #6432)
- **OpenRouter Speech, Transcription and Embeddings** - TTS and STT
through OpenRouter's audio endpoints, and embedding models included in
`ListModels` (#5734, #6264)
- **Grok on Bedrock Mantle** - `xai.` models route through the
`openai/v1` Mantle path (#6022)
- **Gemini 3 Thinking Levels** - A per-model `thinkingLevel` support
table clamps requested levels to the rungs each model implements;
`reasoning_effort: "none"` sets the model's floor level instead of
zeroing `thinkingBudget` (#6280)
- **Datasheet-Backed Compatibility** - Anthropic, Bedrock, Cohere and
Gemini request shaping (adaptive thinking, native effort,
disable-reasoning, mid-conversation system turns, computer-use and
text-editor tool generations, default max output tokens, tool
validation) is resolved from model capabilities instead of hardcoded
model-name checks (#6281, #6492)
- **Reasoning Effort None** - Models that reason by default but do not
support reasoning with tool calls get `reasoning.effort: "none"` when
they advertise `supports_none_reasoning_effort`, instead of losing
`reasoning` entirely (#6293)
- **HTTP Transport Pre-Auth Hook** - New `HTTPTransportPreAuthHook`
plugin phase runs before transport authentication so plugins can inject
credentials such as `x-bf-vk`; a `virtual-key-from-config` native plugin
example ships alongside it (#6375, #6373)
- **Plugin Inject Limits** - Per-plugin `semaphore_size` and
`inject_timeout` on `PluginConfig` bound observability `Inject` calls so
a hung connector releases its slot (#6341)
- **Harness Session Autodetection** - Claude Code, Codex CLI and
OpenCode session headers populate the session ID when `x-bf-session-id`
is absent (#6333)
- **Auth and Model Check Skip Paths** - Context keys let trusted
internal callers bypass auth resolution, and let evaluate-only requests
such as `/inspect` bypass the virtual key provider and model allowlists
while budgets and rate limits still apply (#6124, #6479)
- **Passthrough Encoding Negotiation** - Forwarded `Accept-Encoding` is
filtered to decodable codecs (gzip, deflate, brotli, zstd; gzip and
identity for streams) and chained content encodings are decoded (#6360)
- **Routing Plugin** - Routing rules and the complexity router live in a
dedicated `routing` plugin that runs after governance so rules evaluate
on the fully stamped context; endpoints moved to `/api/routing/rules`
and `/api/routing/complexity-analyzer-config` with deprecated
`/api/governance/*` aliases; complexity routing now reads the text of
mixed text+image turns (#6144, #6145, #6146, #6147, #6253)
- **Dimension Scope Ceiling** - Grouped log analytics (rankings,
histograms, key pairs) are bounded to the customer, team, business unit,
user and virtual key ids the caller may see (#6262)
- **MCP Per-User OAuth and Token Exchange** - MCP clients can hold
per-user OAuth credentials and per-user headers, configurable from
`config.json` as well as the UI, with a documented shared vs
per-identity token lookup contract, `oauth_config.resource` (RFC 8707),
VK/Users filters on the OAuth Grants and MCP Auth Sessions sidebars and
one shared create/install client form; `token_exchange` gains
`use_idp_credentials` to reuse SSO login app credentials for providers
such as Microsoft Entra ID (`client_id` becomes optional) and combines
`offline_access` with `<audience>/.default` for Entra OBO; shared-OAuth
clients show `needs_reauth` when their token row is invalidated,
`Reauthorize` is limited to shared clients, the OAuth flow claim is
atomic against concurrent reauth, stored scopes survive a decode
failure, and credential caches propagate cancellation and version their
entries (#6068, #6069, #6078, #6411, #6428, #6429, #6504)
- **MCP Connection Lifecycle and Tool Discovery** - Discovered tools
persist and resync uniformly across all client types through a
hash-gated core callback, surviving restarts and propagating across a
cluster; connections use make-before-break reconnects with ephemeral
clients rebuilt across the whole connect+init retry, last-known tool
maps preserved, connect attempts bound to entry identity and background
reconnects deduped; `needs_session_stickiness` is pinned across
`config.json` reconciliation; updating static headers on a sticky client
pre-flight verifies the new credential and swaps it onto the live
connection, per-call shared-credential clients refresh tools
synchronously, and a failed enable parks the client at `Disabled` so it
can be retried; the global `tool_sync_interval` hot-reloads and re-times
running checkers; state badges render with spaces and the `disconnected`
filter bucket is now `unstable` (#6409, #6430, #6431, #6483, #6502)
- **Air-Gapped MCP Catalog** - `mcp_library_sync_interval: 0` disables
catalog sync and `file://` URLs load the MCP server library from disk
(#6195)
- **MCP Log Redaction and Plugin Logs** - MCP tool logs carry redaction
mappings and plugin logs (#5744, #5746)
- **Splunk Connector Configuration** - `config.schema.json`, Helm values
and dashboard entries for the Splunk HEC observability connector (#6296,
#6091, #6099)
- **Helm Broker Clustering** - `bifrost.cluster.type: broker` with
broker address, port and TLS settings alongside the existing mesh
transport (#6398)
- **HTTP/2 Ping Interval in the UI** - Provider network configuration
exposes `http2_ping_interval_in_seconds` (#6228)
- **Status Code Badges** - Error and passthrough logs show the upstream
HTTP status code in the log detail header (#5536)
- **Server-Side Tool Calls in Logs** - `web_search_call`,
`code_interpreter_call` and similar Responses items render their full
payload in the log detail view (#6475)
- **Gemini Server-Side Tool Calls** - Gemini `toolCall`/`toolResponse`
parts surface as `web_search_call` items with their own call ID and
queries, unmapped tool types are preserved on the native round-trip, and
each `thoughtSignature` appears exactly once on replay (#6071)
- **Bedrock VPC Endpoints** - AWS Bedrock keys can target VPC endpoints
(#6064)
- **W3C Trace ID Propagation** - Requests carry a W3C trace ID on the
context (#5945)
- **Durable Background Jobs** - New `sidekiq` background-job table,
store methods, and runner with recovery and reaper; cost recalculation
migrated to a durable, resumable and cancellable job with polling
instead of SSE (#5800, #5801)
- **Separate OTEL Metrics Pipeline** - The OTEL collector supports a
metrics tab independent of traces, plus separate headers for traces and
metrics (#5939, #5940)
- **Grouped Logs View** - The logs table groups fallback chains under
expandable roots backed by the new `roots_only` filter with child
aggregates, and the model catalog persists tab, search and provider in
the URL (#5522, #5737, #6059)
- **User Agent and App Attribution** - Logs and MCP tool logs record
user agent, app, source, decision, app key and device ID, with custom
user-agent mapping and dashboard dimension rankings; MCP tool logs
observed by the Bifrost Edge agent can be ingested with device, app key,
decision and source attribution
- **S3 Log Export Metadata** - Additional metadata is written alongside
S3 log exports (#6070)
- **Matview Maintenance Off Switch** - `matview_refresh_interval`
accepts `"off"` to disable logstore matview maintenance entirely (thanks
[@jeremym-tanium](https://github.com/jeremym-tanium)!) (#5693)
- **Video Request Info in Logs UI** - Video requests surface their
details in the logs UI (#5946)
- **Shell Rewriter Hook** - The UI handler exposes a `ShellRewriter`
hook for pre-hydration HTML rewriting (#5807)
- **Custom Branding** - Logo and icon branding support with an OSS
fallback stub, cached in localStorage to prevent a logo flash on load
(#5806, #6096)
- **User Assignment on Virtual Keys** - Users can be assigned from the
virtual key sheet (#5863)
- **Quarterly Budgets** - Quarterly budget windows with a configurable
fiscal year start for customers and virtual key provider configs,
surfaced in budget labels (#5996, #5997, #5999, #6115, #6116)
- **Sarvam AI Provider** - Added Sarvam AI as a first-class provider
with chat, text-to-speech, and speech-to-text support (thanks
[@Purvi09](https://github.com/Purvi09)!)
- **ElevenLabs Sound Effects** - Added text-to-sound generation support
via `/v1/sound-generation` (thanks
[@SecretSun](https://github.com/SecretSun)!)
- **Bedrock Project Scoping** - Added optional `project_id` to Bedrock
and Bedrock Mantle key configs with per-alias overrides for Bedrock,
Bedrock Mantle, and Vertex, plus UI support
- **Trace Redaction** - Phase-scoped redaction and revealing, transient
redaction data field for guardrails, and trace content redaction before
connector export
- **Audit Log Object Storage** - S3/GCS object storage config schema for
audit log archival
- **Alerting Configuration** - Alerting schema in `config.schema.json`
with declarative channels and CEL-based rules, Helm chart support, and
enterprise fallback pages
- **Canonical Model Names** - Dashboard model rankings now show
canonical model names instead of inference-profile IDs (thanks
[@satyamkrishna](https://github.com/satyamkrishna)!)
- **OAuth2 Hardening** - Allowlist for private-use redirect URI schemes
(RFC 8252 §7.1) and a `shouldSweep` gate on the OAuth2 sweep worker
- **Mirrored Schema Support** - `schema_url` / `BIFROST_SCHEMA_URL` for
mirrored schema locations in isolated deployments
- **Vertex Single-Region Config** - Enforce single-region configuration
in Vertex key config
- **Helm Chart Updates** - `bifrost.alerting`, audit-log object storage,
`postgresql.external.port` string support, and
`bifrost.mcp.toolGroups[*].id`
- **ChatGPT Passthrough** - Added a ChatGPT passthrough route on the
OpenAI integration with dedicated request handling
- **Edge Fallback Pages** - Added fallback pages for Bifrost Edge
control views (config, devices, inventory) backed by governance resolver
support
- **Agent Handover View** - Added an agent handover page with seeded
end-to-end data support
- **First-Time Setup Token** - A setup token gates first-time setup so a
fresh deployment is not open to the world, and the onboarding checklist
is back, completing its dashboard auth step on SSO deployments (#5759,
#5784, #6322)

## 🐞 Fixed

- **Structured Output Schema Order** - `response_format` JSON schemas
are forwarded byte-for-byte to OpenAI, Anthropic, Bedrock, Gemini and
Cohere so the model generates fields in the caller's declared order
instead of a re-sorted one (#6235)
- **Thinking Block Typing on Streams** - Reasoning items carrying both
an encrypted payload and a visible summary open as `thinking` blocks
instead of `redacted_thinking` (#6292)
- **Replayed Thinking Blocks via `bedrock/` Prefix** - Content-less
`tool_result` blocks are kept, interleaved block order is preserved,
`incomplete` maps to `error` on Converse, and pending reasoning is
consumed by its owning item, so multi-turn tool use no longer wedges
(#6346)
- **Gemini 400s on Claude Code Traffic** - Trailing assistant prefills
are trimmed and mid-conversation system turns are inlined for
Gemini/Vertex; `extra_fields` is echoed on `/anthropic/v1/messages`
(#6363)
- **Bedrock Tool Use IDs** - IDs longer than 64 characters or outside
Bedrock's charset (such as Gemini thought-signature IDs) are aliased
deterministically on both `tool_use` and `tool_result` (#6300)
- **Azure Responses Stream Errors** - Terminal `error` and
`response.failed` events inside an already-open HTTP 200 SSE stream are
surfaced as errors with their nested type, code and message (thanks
[@dani29](https://github.com/dani29)!) (#6302)
- **GenAI SSE Heartbeats** - GenAI streams delimit heartbeat comments so
Google SDK clients preserve the following event, while older openai-go
clients keep the bare heartbeat (thanks
[@dani29](https://github.com/dani29)!) (#6252)
- **OpenCode max_tokens** - `max_tokens` is preserved for
OpenCode-compatible chat endpoints (thanks
[@Alex-wangyang](https://github.com/Alex-wangyang)!) (#6458)
- **HuggingFace Streaming Usage** - HuggingFace is no longer listed as
omitting the `[DONE]` marker, and `stream_options.include_usage`
defaults on its chat streaming path, so streamed calls stop reporting
zero tokens and zero cost (thanks
[@elliottrabac](https://github.com/elliottrabac)!) (#6478)
- **Provider Key Name on Update** - A key PUT that omits `name` no
longer clears it, and already-exists errors keep their constraint detail
(thanks [@cpsc](https://github.com/cpsc)!) (#6417)
- **Bedrock Mantle Streaming** - Bedrock Mantle is registered in
`ProviderSendsDoneMarker` so streams end after `finish_reason` (#6021)
- **URL-Sourced Files and Images** - `gs://` URIs go to Gemini/Gemma as
`fileData.fileUri` and are read from Cloud Storage for Claude-on-Vertex,
`s3://` references go to Bedrock Converse as `s3Location`, Bedrock
rerank synthesizes the foundation-model ARN from a bare model ID, OpenAI
file blocks keep `file_url`, non-http schemes pass through on the OpenAI
and native-Anthropic paths, and Gemini always emits a candidate with its
finish reason and drops payload-free parts (#6239)
- **Together and Alias Pricing** - The management catalog resolves
runtime provider `together` to the datasheet identity and prices
configured aliases through their target model (thanks
[@dani29](https://github.com/dani29)!) (#6257, #6320)
- **Redis Vector Store TAG Escaping** - All RediSearch special
characters are escaped in TAG query values (thanks
[@AdityaPainuli](https://github.com/AdityaPainuli)!) (#5351)
- **MCP Tool Sync Interval Corruption** - Toggling an MCP client's
enable/disable switch no longer corrupts `tool_sync_interval`; the value
is a whole number of minutes, negative values are rejected instead of
silently disabling sync, and re-enabling a per-call client restarts its
discovery cycle (#6409, #6502)
- **MCP Tool Map Staleness** - `SetClientTools` replaces the in-memory
tool map instead of merging, so tools removed upstream leave memory once
the database has dropped them (#6484)
- **SSE Reconnect Identity** - `OnConnectionLost` on SSE MCP clients is
gated on connection identity so a stale connection cannot tear down its
replacement
- **Connector Header Redaction** - `Authorization`, `x-api-key`,
Cloudflare Access and AWS ALB OIDC headers are redacted before export to
every observability backend (#6371)
- **Vertex Mixed Tools** - Vertex AI accepts function declarations and
Google Search in the same request without
`includeServerSideToolInvocations`, and search localization via
`retrievalConfig.latLng` is preserved (#6066)
- **Gemini Tool Preference** - When tool combination is disabled,
function declarations win over Google Search so the model can still call
the caller's tools (#6065)
- **Bedrock Stop Reasons** - Bedrock `content_filter` and
`guardrail_intervened` stop reasons map to `incomplete` status with a
`content_filter` reason
- **Encrypted Reasoning on Compaction** - The fail-soft that strips
`encrypted_content` before retrying a rejected request also covers
`/v1/responses/compact` and count-tokens requests, and recognizes
Anthropic's `redacted_thinking` rejection (#6041, #5960)
- **DAC-Scoped VK Reads** - `from_memory` virtual key reads are blocked
for DAC-scoped callers
- **Path Normalization Auth Bypass** - Fixed a path normalization flaw
that allowed auth to be bypassed (#5763)
- **Minimal Reasoning Effort on GPT-5 Models** - `reasoning_effort:
"minimal"` is preserved for GPT-5-family OpenAI models instead of being
downgraded to `low` (thanks [@jitokim](https://github.com/jitokim)!)
(#6046)
- **Gemini Truncated Response Finish Reason** - Truncated Gemini
responses report `MAX_TOKENS` instead of `OTHER` (thanks
[@AdityaPainuli](https://github.com/AdityaPainuli)!) (#5979)
- **Null Tool-Call Function Name on Streaming** - Streaming continuation
deltas no longer materialize an absent tool-call function name as `null`
(thanks [@AdityaPainuli](https://github.com/AdityaPainuli)!) (#5966)
- **Bedrock Document Uploads** - Fixed Bedrock file handling in
inference so office and PDF documents sent as OpenAI `type: "file"` are
accepted (#5947)
- **xAI Usage Cost** - Fixed USD cost ticks for xAI usage (#5950)
- **Governance List-Models Call** - Budgets and rate limits no longer
trigger a list-models call (#6051)
- **Realtime Response Create Input** - Guarded `response.create` input
(#6050)
- **Governance Rate-Limit Reset CPU** - Guards against invalid reset
timeouts, parallelized resting-budget flows only when absolutely
required, and fixed the calendar-based alignment qualifier
- **Masked Key Persistence** - Never persist masked provider key
previews to config storage (thanks
[@eyeveil](https://github.com/eyeveil)!)
- **OpenShift Arbitrary UIDs** - Build-time group-0 ownership with no
runtime chown (thanks [@eyeveil](https://github.com/eyeveil)!)
- **Passthrough Virtual Key Attribution** - Passthrough calls via the
Azure `api-key` header now attribute to the virtual key (thanks
[@eyeveil](https://github.com/eyeveil)!)
- **Rerank for Custom Providers** - `/v1/rerank` now works with custom
OpenAI-compatible providers (thanks
[@eyeveil](https://github.com/eyeveil)!)
- **Responses Stream Usage** - Persist stream usage when providers omit
or reuse sequence numbers (thanks
[@eyeveil](https://github.com/eyeveil)!)
- **Wildcard allowed_models Repair** - Repair bare wildcard
`allowed_models` rows that broke admin provider updates (thanks
[@eyeveil](https://github.com/eyeveil)!)
- **Streaming Error Panic** - Nil-safe tracing span lookup prevents
panics on streaming errors (thanks
[@eyeveil](https://github.com/eyeveil)!)
- **Anthropic Tool ID Sanitization** - Sanitize `tool_use`/`tool_result`
ids to Anthropic's charset (thanks
[@Shaik-Sirajuddin](https://github.com/Shaik-Sirajuddin)!)
- **Realtime Transcription Sessions** - Support GA transcription-type
sessions in `POST /v1/realtime/client_secrets` (thanks
[@Shaik-Sirajuddin](https://github.com/Shaik-Sirajuddin)!)
- **Diarized Transcription** - Support `diarized_json` segments and
ElevenLabs speaker passthrough (thanks
[@Shaik-Sirajuddin](https://github.com/Shaik-Sirajuddin)!)
- **Model Discovery** - Skip disabled keys when scheduling
model-discovery fetches (thanks
[@Shaik-Sirajuddin](https://github.com/Shaik-Sirajuddin)!)
- **MCP Timeout Placeholder** - Show the real global default in the MCP
tool execution timeout placeholder (thanks
[@Shaik-Sirajuddin](https://github.com/Shaik-Sirajuddin)!)
- **Redacted Thinking Round-Trip** - Round-trip Anthropic
`redacted_thinking` blocks on the Responses surface (thanks
[@fus3r](https://github.com/fus3r)!)
- **Streaming Accumulation** - Preserve citation annotations and
`finish_reason` in the accumulated streaming response (thanks
[@fus3r](https://github.com/fus3r)!)
- **Gemini Grounded Streaming** - Reset web-search flag when recycling
pooled stream state so `web_search_call` items keep emitting (thanks
[@fus3r](https://github.com/fus3r)!)
- **Bedrock Truncation Signal** - Signal `max_output_tokens` truncation
on the Responses API (thanks
[@jeremym-tanium](https://github.com/jeremym-tanium)!)
- **Bedrock Reasoning Config** - Preserve `reasoning_config` on
cross-provider translation so fallbacks keep extended thinking (thanks
[@Purvi09](https://github.com/Purvi09)!)
- **Anthropic tool_search** - Forward and rebuild server-side
`tool_search` on the Responses path (thanks
[@ws4charlie](https://github.com/ws4charlie)!)
- **OpenAI Responses Input** - Strip `role` from non-message input items
(thanks [@nettee](https://github.com/nettee)!) and serialize compaction
request `input` correctly (thanks
[@mcclurmc](https://github.com/mcclurmc)!)
- **additional_tools Support** - Added `additional_tools` message type
support, preserving nested tool types on `/v1/responses`
- **Plugin Stream Errors** - Emit structured plugin stream errors on
integration routes (thanks [@jeffhos](https://github.com/jeffhos)!)
- **Pooled Object Hygiene** - Zero pooled ChannelMessage references on
release and sweep orphaned deferred spans in trace store TTL cleanup
(thanks [@citrocat](https://github.com/citrocat)!)
- **Hybrid Log Token Usage** - Rebuild token usage from denormalized
columns in hybrid log list (thanks [@G-XD](https://github.com/G-XD)!)
- **MCP Tool Ordering** - Deterministic MCP tool ordering for prompt
cache stability
- **MCP Inline-Auth Links** - Warn callers not to truncate the `#t=`
temp-token fragment (thanks
[@MarcusPeng](https://github.com/MarcusPeng)!)
- **Gemini Fixes** - Web search options map to Google Search grounding,
file upload MIME types preserved, and video reference fields map to
instances (thanks [@vojthor](https://github.com/vojthor)!)
- **OpenAI Parameters** - Honor service tier in chat completion and cap
max reasoning effort
- **Anthropic Costing** - Correct inference geo cost and cache rate for
fast mode
- **SecretVar Parsing** - Parse `SecretVar` JSON with `ref`/`env_var`
fields even when `value` is absent
- **Telemetry** - Forward request id and trace id, reduce metrics
cardinality explosion risk, and send status codes on OTEL metrics
- **Dashboard** - Preserve active time period when applying dimension
filters, adjust bucket size thresholds for month-range durations, show
user popover with `preferred_username` fallback, filter provider-level
keys from the prompt manager selector (thanks
[@rlex](https://github.com/rlex)!), skip password validation for
redacted credentials, and improve `ModelMultiselect` empty and error
states
- **API Key Provider Selection** - Fixed provider selection for API keys
- **Azure Auth Headers** - Pass Azure auth headers in helpers
- **Stream Delta Schema** - Added `ExtraContent` to
`ChatStreamResponseChoiceDelta` (thanks
[@nghodkicisco](https://github.com/nghodkicisco)!)
- **API Auth Bypass** - Stopped `/api/devices` bypassing auth via the
`/api/dev` prefix
- **Bedrock Error Types** - Surface the AWS exception type
(`X-Amzn-Errortype`) on non-streaming Bedrock error responses instead of
dropping it

## 🔧 Maintenance

- **Hot-Path Performance** - Cached serialization for shared MCP tools,
a direct `OrderedMap` JSON writer, bulk span attribute writes with
cached span pointers, reusable worker delivery timers, retained span
attribute maps, generation-stamped memoization of `GetProvidersForModel`
and `GetModelsForProvider` via the new `gencache` package, sonic-based
JSON responses, and a plugin-log existence check before draining (#6242,
#6241, #5956, #5957, #5657, #6387, #5641, #6224, #6268, #6211)
- **Go Toolchain** - Modules build with Go 1.26.6 and the Nix flake pins
1.26.7 (#6269, #6385)
- **Dependency Upgrades** - Dependabot updates across all modules,
newman 6.2.2 with pinned transitive overrides, module path fixes and
`openai_config` referenced from every provider config schema (#6040,
#5864, #6267, #6305, #6275)
- **Test Coverage** - vLLM instances provisioned on RunPod in the
release pipeline, Runware harness coverage including `/v1/images/edits`
and `/v1/videos`, batch and pricing-override lifecycle harness cases, an
Anthropic `message_start` usage regression test, LangChain rerank and
embedding integration tests, and e2e fixes for dashboard auth, budget
reset and MCP state (#5541, #6303, #6319, #6299, #6327, #6432, #6351)
- **Documentation** - v2.0.0 migration guide with the governance
namespace mapping and a v1.5.x downgrade guide for `prerelease3`
deployments, v2.0.0 availability callouts, routing API namespace docs,
Bedrock application inference profiles, Splunk connector docs,
config.schema.json and Datadog env var reference fixes, and Discord
badge fixes (thanks [@Swpn0neel](https://github.com/Swpn0neel)!) (#6332,
#6374, #6420, #6147, #6203, #6099, #5938, #6019, #6425, #6448)
- **Helm** - Chart releases v2.1.35 and v2.1.36 (#6129, #6249)
- **Governance Route Families** - Editions can override governance route
families (#5839)

## 🗄️ Database Migrations

All migrations below are new relative to v1.6.11. Deployments on an
older v1.6.x release should also review the intermediate v1.6.x
changelogs.

**configstore:**

- **add_mcp_client_pending_oauth_config_json_column** - Adds
`pending_oauth_config_json` to `config_mcp_clients`. Reversible: drops
the added column.
- **merge_oauth_token_tables** - Consolidates `oauth_tokens` and
`oauth_user_tokens` into `mcp_oauth_tokens`. **Non-reversible**:
rollback deliberately leaves `mcp_oauth_tokens` in place, because every
OAuth read and write targets it from this migration onward and dropping
it would destroy any token created or refreshed since, forcing every
holder to re-authorize.
- **create_mcp_oauth_flows_table** - Creates `mcp_oauth_flows` to track
in-flight OAuth flows. Reversible: drops the new table.
- **drop_oauth_config_pkce_columns** - Drops CSRF state, PKCE verifier
and `expires_at` from the OAuth config table now that they live on
`mcp_oauth_flows`. **Non-reversible**: forward-only, the dropped values
were per-flow ephemeral and re-adding empty columns would restore
nothing.
- **drop_oauth_config_token_id_column** - Drops `token_id`.
**Non-reversible**: forward-only, it was a pure FK shortcut now
reachable via `(oauth_config_id, auth_mode)`.
- **add_mcp_admin_auth_mode_indexes** - Adds admin partial unique
indexes on `mcp_oauth_tokens` and `mcp_per_user_header_credentials`.
Reversible: drops both indexes.
- **add_mcp_client_token_exchange_json_column** - Adds
`token_exchange_json` to `config_mcp_clients`. Reversible: drops the
added column.
- **add_needs_session_stickiness_column** - Adds
`needs_session_stickiness` to `config_mcp_clients`. Reversible: drops
the added column.
- **add_bedrock_endpoints_columns** - Adds Bedrock VPC endpoint columns
to the keys table. Reversible: drops the added columns.
- **add_cost_per_request_pricing_column** - Adds `cost_per_request` to
model pricing. Reversible: drops the added column.
- **add_notifications_table** - Creates the `notifications` table for
the dashboard notification center. Reversible: drops the table.
- **add_batch_jobs_table** - Creates `batch_jobs` with a unique
`(provider, batch_id)` identity index, a sweeper scan index and a
runner-id index. Reversible: drops the table.
- **add_image_megapixel_tier_pricing_columns** - Adds the five
`output_cost_per_image_above_{4,8,16,32,64}_megapixels` columns to model
pricing. Reversible: drops the added columns.
- **add_input_cost_per_query_column** - Adds `input_cost_per_query` to
model pricing for rerank. Reversible: drops the added column.
- **add_ultrafast_pricing_columns** - Adds the four `*_ultrafast` token
rate columns to model pricing. Reversible: drops the added columns.
- **add_image_size_quality_pricing_columns** - Adds the 14 per-size and
size+quality image output rate columns to model pricing. Reversible:
drops the added columns.
- **add_batch_jobs_attribution_columns** - Adds `user_id`, `team_id`,
`customer_id` and `source_log_id` to `batch_jobs` plus a `user_id`
index. Reversible: drops the index and the four columns.

**logstore:**

- **logs_add_guardrail_debug_column** - Adds `guardrail_debug` to logs.
Reversible: drops the added column.
- **mcp_tool_logs_add_redaction_mapping_column** - Adds the redaction
mapping column to MCP tool logs. **Non-reversible**: rollback is a no-op
because dropping the column would permanently destroy reveal data for
already-redacted MCP logs.
- **logs_add_user_agent_column** - Adds user agent and app columns,
their indexes, and a `UserAgentMapping` table. Reversible: drops the
indexes and the mapping table.
- **mcp_tool_logs_add_user_agent_column** - Adds user agent and app
columns plus indexes to MCP tool logs. Reversible: drops both indexes
and the `app` column.
- **logs_recreate_matviews_with_app_column** - Recreates the log
materialized views to include the user agent and app columns. Rollback
is a no-op because `ensureMatViews` recreates them on next startup.
- **mcp_tool_logs_add_endpoint_columns** - Adds `source`, `decision`,
`app_key` and `device_id` to MCP tool logs. Reversible: drops all four
columns.
- **mcp_tool_logs_add_plugin_logs_column** - Adds `plugin_logs` to MCP
tool logs. Reversible: drops the added column.
- **logs_add_video_edit_input_column** - Adds `video_edit_input` to
logs. Reversible: drops the added column.
- **logs_add_upstream_and_overhead_latency_columns** - Adds
`upstream_latency` and `overhead_latency` to logs. Reversible: drops
both columns.
- **logs_add_batch_debug_column** - Adds `batch_debug` to logs.
Reversible: drops the added column.
- **logs_add_cost_breakdown_columns** - Adds `input_cost`, `output_cost`
and `additional_cost` to logs. Reversible: drops the three columns.
- **logs_recreate_matviews_with_cost_breakdown** - Marks the hourly
matview for rebuild with the cost split columns; `repairMatViewShapes`
drops and recreates `mv_logs_hourly` on the next startup. Rollback is a
no-op because `ensureMatViews` recreates it on next startup.
- **logs_add_overhead_breakdown_column** - Adds `overhead_breakdown` to
logs. Reversible: drops the added column.

<Warning>
**High-throughput deployments: run the logstore migrations during a
low-activity window.**

Every logstore migration above alters `logs` or `mcp_tool_logs`, the two
highest-insert tables in Bifrost, and several also build indexes on
them. On a busy instance the index builds hold locks that block
concurrent log inserts for the duration of the build, and the matview
recreations rebuild against the full table. Schedule the upgrade for a
low-traffic period, or expect elevated log-write latency and possible
request-path backpressure while the migrations run.
</Warning>

<Warning>
`merge_oauth_token_tables`, `drop_oauth_config_pkce_columns` and
`drop_oauth_config_token_id_column` transform or remove existing OAuth
state and cannot be rolled back. Take a database backup before
upgrading, and do not roll the binary back past this release once the
migration has run.
</Warning>

## 🐙 Closed GitHub Issues

- [#123](#123) - Files API
Support
- [#2347](#2347) - MCP tool
ordering is non-deterministic, breaking prefix-based prompt caching
- [#3455](#3455) - Segfault/nil
dereference panic in Bedrock provider
- [#4318](#4318) -
allowed_models persisted as bare "*" string blocks subsequent provider
updates
- [#4353](#4353) - config.db
corruption from masked-key preview in provider_configs JSON column
- [#4367](#4367) - Image
incompatible with OpenShift arbitrary UIDs
- [#4402](#4402) - Vertex
provider drops image blocks whose URL uses gs:// scheme
- [#4477](#4477) - Passthrough
calls using a Virtual Key log as actual key
- [#4679](#4679) - Bedrock
Responses API does not signal max_output_tokens truncation
- [#4689](#4689) - Custom
providers cannot set budget
- [#4712](#4712) - ElevenLabs
sound effects (/v1/sound-generation)
- [#4780](#4780) - Anthropic
server-side tool_search results are dropped on /v1/responses
- [#4834](#4834) - /v1/rerank
is not available with custom providers
- [#4846](#4846) - Responses
stream usage present in response.completed but not persisted in LLM Logs
- [#4851](#4851) - Governance
rate-limit reset causes high CPU in BumpRateLimitUsage
- [#4870](#4870) - Pooled
ChannelMessage retains request body, context, and undelivered response
while idle
- [#4940](#4940) - Show
canonical model names instead of Bedrock inference-profile IDs in Model
Rankings
- [#4963](#4963) - Streaming
finish_reason dropped from the accumulated (logged) response
- [#5002](#5002) -
gpt-4o-transcribe-diarize transcription fails due to string segment IDs
- [#5013](#5013) - OpenAI
/responses/compact input serialized as a JSON object causing 400
- [#5026](#5026) - [Bug]:
Toggling an MCP client's enable/disable switch corrupts its
tool_sync_interval (nanoseconds resent as minutes)
- [#5027](#5027) - MCP Tool
Execution Timeout placeholder shows 0 instead of real global default
- [#5036](#5036) - Plugin
StreamInterceptionError is flattened on integration routes
- [#5037](#5037) - Disabled
keys break provider model discovery
- [#5051](#5051) - Add Sarvam
AI provider (chat + TTS/STT)
- [#5061](#5061) - Streaming
responses drop citation annotations from the accumulated message
- [#5093](#5093) - Streaming
/v1/responses drops Anthropic redacted_thinking blocks
- [#5097](#5097) - Anthropic
rejects replayed tool_use/tool_result ids from non-conforming upstream
providers
- [#5100](#5100) -
additional_tools loses nested tool types on /v1/responses
- [#5101](#5101) -
Chat-to-Responses tool replay sends role on function_call input items
- [#5108](#5108) - Bedrock
reasoning_config silently dropped on cross-provider translation
- [#5113](#5113) -
Gemini/Vertex streaming stops emitting web_search_call items after first
grounded request
- [#5432](#5432) - Add TTS and
STT support for OpenRouter
- [#5472](#5472) - [Bug]:
Bedrock rejects office/PDF document uploads via OpenAI `type:"file"` -
"The PDF specified was not valid"
- [#5871](#5871) - [Bug]: AWS
Bedrock Mantle streaming is broken
- [#5874](#5874) - [Bug]: SSE
heartbeat frame aborts streams for openai-go ssestream consumers (<
v3.43.0) with "unexpected end of JSON input"
- [#5885](#5885) - [Bug]:
v1.6.8 omits message_start.message.usage on Bedrock-backed providers,
breaking @ai-sdk/anthropic streaming
- [#5900](#5900) - [Bug]:
Streaming continuation chunks materialize omitted tool-call metadata as
null
- [#5978](#5978) - [Bug]:
Gemini egress reports truncated responses as FinishReason OTHER,
IncompleteDetails switch matches a string that never occurs
- [#6044](#6044) - [Bug]:
normalizeOpenAIReasoningEffort maps 'minimal' to 'low' for ALL OpenAI
models, even ones that natively support 'minimal'
- [#6240](#6240) - [Bug]: GenAI
SSE heartbeat framing causes @google/genai to silently drop the
following data event
- [#6248](#6248) - [Bug]:
OpenRouter embedding models missing from Semantic Cache dropdown
- [#6334](#6334) - [Bug]:
Gemini/Vertex provider fails on Claude Code assistant prefills and
mid-conversation system turns (Gemini 3.6 Flash & 3.7 Flash HTTP 400)
- [#6342](#6342) - [Bug]:
Anthropic ingress with bedrock/ prefix restructures replayed thinking
blocks, wedging multi-turn tool use on claude-opus-4-8
- [#6416](#6416) - [Bug]:
Provider key update silently clears "name" when omitted, then the
unique-name index 409s subsequent updates
- [#6457](#6457) - [Bug]:
OpenCode chat endpoints drop max completion limit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants