Repository navigation
BAI-1609 add identity_assertion to the MCP auth values - #171
Conversation
There was a problem hiding this comment.
Gecko PR Review
No vulnerabilities found, LGTM.
Summary
This PR adds an identity_assertion value to the auth Literal in languagemodelcommon/configs/schemas/config_schema.py and languagemodelcommon/configs/schemas/mcp_json_schema.py, so both the agent config and the MCP JSON entry now accept it. The library only validates and carries the value; the consuming service must generate and sign the short-lived, server-addressed token, so the security guarantees depend on that out-of-repo implementation. The new tests/configs/test_auth_values.py checks that every documented auth value validates, but the diff is truncated and does not show whether invalid values or the token-signing contract are tested. No wiki context was provided, so this assessment relies only on the diff.
Important Files Changed
2 important files out of 4 changed
| File Path | Why it matters |
|---|---|
languagemodelcommon/configs/schemas/config_schema.py |
Adds identity_assertion to the AuthenticationConfig.auth Literal, which widens the set of accepted authentication modes for agent configs and is the schema the consumer relies on for validation. |
languagemodelcommon/configs/schemas/mcp_json_schema.py |
Mirrors the same identity_assertion Literal in McpServerEntry.auth, so MCP server JSON entries can now request a consumer-signed identity token, and both schemas must stay in sync. |
Omitted 2 lower-signal changed files.
Sequence Diagram
sequenceDiagram
participant Reviewer
participant PR as Changed Files
Reviewer->>PR: Inspect changed files and control flow
Reviewer->>Reviewer: Validate security assumptions
Edit Gecko PR Settings | Reviewed commit: 04c659e
There was a problem hiding this comment.
I reviewed this PR and found no bugs. It is worth a human look because it changes which auth modes are accepted. Before this PR, a config with auth: identity_assertion failed validation. Now it passes, and what happens next depends on each consumer of this library.
What was reviewed:
- The
authLiteral inAuthenticationConfig(config_schema.py) andMcpServerEntry(mcp_json_schema.py). The six values match in both, and no existing value or default changed. resolve_mcp_serversin mcp_json_reader.py copies the value through unchanged. Whenoauthis set it still overridesauthtojwt_token, as it does for every other value. The only auto-set rule,headers, runs only whenauthis unset.- Nothing else in
languagemodelcommon/branches onauth, so this library adds no behavior. A consumer on the new version that doesn't handleidentity_assertionmay fall back to its default path, which could mean forwarding the caller's token. Please check each consumer, not just baileyai-skills-service.
Extended reasoning...
The change adds one value to the auth Literal in two Pydantic schemas, rewords the field descriptions, and adds tests for accepting and rejecting values and for passing the value through .mcp.json resolution. The tests follow the keyword-only and parametrize conventions. No auth logic changes in this repo, and CODEOWNERS covers only AGENTS.md and CLAUDE.md. This is still a defer because the field controls how a caller's credentials reach MCP servers. A config that used to fail validation now passes, so whether that is safe depends on downstream services this review cannot see.
alvinhenrick
left a comment
There was a problem hiding this comment.
Approving at 04c659e.
What I checked:
config_schema.py(AuthenticationConfig.auth) andmcp_json_schema.py(McpServerEntry.auth): both Literals gain exactlyidentity_assertion, the six values match across the two schemas, and no default or existing value changed. Purely additive.tests/configs/test_auth_values.py: these are real Pydantic validations, not mocks. The accept case is parametrized over all six values on both models. The reject case covers the near-missidentity-assertionand an empty string, which catches a typo'd config.test_identity_assertion_auth_is_kept_as_isruns the realresolve_mcp_servers, so the pass-through is checked on the actual resolution path.
Non-blocking, for the release notes: once a consumer bumps to this version, configs with auth: identity_assertion validate where they used to fail. Any consumer that matches on auth (baileyai, mcp-fhir-agent, not just skills-service) needs either an explicit branch for the new value or a default branch that fails closed. Otherwise an unhandled value could fall through to a path that forwards the caller's token. Pin the skills-service floor as planned and check the other consumers' match defaults before they bump.
Single commit, Jira key present, no AI-attribution trailer. I can't verify CI status through this integration (the check-runs/status endpoints 403), so this approval rests on reading the diff, not on CI.
EA Review: PR #171Merge Readiness: READY_WITH_FIXES Risk label: none present, and this repo has no label gate or classifier, so the tier is Fixed during this review
Should-fix
Nits
Other
|
What
Adds
identity_assertionto the MCP serverauthvalues in both schemas that define them (AgentConfig.authinconfig_schema.pyandMcpServerEntry.authinmcp_json_schema.py), with updated descriptions and tests (a parametrized accept/reject test over every value, and an.mcp.jsonresolution test).identity_assertionmeans the consuming service sends the MCP server a short-lived token it signs itself, carrying only the person id and addressed to that server, instead of the caller's own token. This library only carries the value; there is no behavior keyed on it here. The consumer (baileyai-skills-service) implements it.Why
Part of the plugin MCP tool approval work (baileyai-skills-service #380, #382, #385; BAI-1609). A plugin's
.mcp.jsonrequests an auth type and the service's approvals file grants it, so a person-scoped vendor token needs to be a value the.mcp.jsoncan request. Todayauthrejects any value outside the existing five.Scope boundary
Covers only the two
Literalvalues, descriptions and tests. Defers: the consumer-side handling (baileyai-skills-service), and the version bump there after release. No existing value changes and no default changes; configs that omit the value are unaffected.Consumers affected and how they were checked
authismcp_json_reader.py(copies the value through;oauthstill overrides it tojwt_token, now covered by a test foridentity_assertionas well aspass_through) andresponses_api_request_wrapper.py(setsheadersonly). Nothing branches on the new value.LiteralthroughAgentConfig.model_validate(registry_loader.py), so it rejectsidentity_assertionuntil it bumps to the release of this PR. Handling of the value is in its #385. Its docstring atregistry_loader.py:262lists the old five values and gets updated there.authvalues (only an unrelatedpass_through_headerssetting), and configs that omit the value are unaffected. Not run against a build of this change.Governing artifacts
docs/adr/0015-plugin-mcp-tool-approval.md(in #385). The signer, audience and consumer contract foridentity_assertionare specified there, not here.identity_assertionis the one used in the design, ADR and the baileyai-configuration approvals schema (baileyai-configuration Improve MCP tool error handling and search_tools category-aware resolution #36), so it is kept for consistency.authLiteral is duplicated inconfig_schema.pyandmcp_json_schema.py(pre-existing); a shared alias is a separate change.Tests
tests/configspasses (255 tests). Pre-commit passes.