docs: add authentication guide and scope MCP guide to AIQ 2.1 - #212
Conversation
- New deployment/authentication.md covering OAuth/OIDC sign-in, backend JWT validation, AIQ token usage in tools, and pass-through to MCP integrations. - Rewrite customization/mcp-tools.md around the NAT 1.6 MCP surface: mcp_client, mcp_service_account, native per-user MCP OAuth, AIQ token pass-through patterns, and publishing AIQ as an MCP server. - Wire both pages into the deployment and top-level docs indexes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Ajay Thorve <athorve@nvidia.com>
Restructure docs/source/customization/mcp-tools.md around what AIQ 2.1 actually supports out of the box, instead of walking through workaround recipes for flows the blueprint does not yet integrate end to end. Supported patterns (kept as full walkthroughs): - mcp_client for unauthenticated MCP servers - mcp_service_account (incl. dual-auth example) for backend-credential MCP - AIQ-user-identity tools using aiq_agent.auth.get_auth_token() - nat mcp serve / nat fastmcp server run for publishing AIQ as MCP Deferred to AIQ 2.2 / 2.3 (kept as a short, honest planning note): - Per-user MCP OAuth driven by the AIQ UI. NAT 1.6 ships the protocol-level building blocks (mcp_oauth2, per_user_mcp_client) but AIQ 2.1 lacks the UI controls, the per-MCP auth-status surface on /v1/data_sources, and the async-job worker-side per-user MCP token resolution required to deliver this end to end. - A first-party AIQ-token pass-through MCP auth provider. Today this requires implementing a custom NAT auth provider in your deployment package; AIQ does not ship one. Cuts: - The three "Options 1/2/3" pass-through recipes collapse to a single "Forwarding AIQ User Identity from a Tool" section with the working internal_search example. - The long native per-user OAuth walkthrough (Jira example, redirect URI setup) is replaced by a short note pointing at the NAT MCP auth guide. - The "Does AIQ Need Separate UI Login..." combinatorial table. - The custom-provider Python skeleton for aiq_user_token_passthrough (the doc no longer recommends a flow AIQ does not provide out of the box). Net: 395 lines, down from 622. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Ajay Thorve <athorve@nvidia.com>
c281b25 to
622e8b2
Compare
Greptile SummaryThis doc-only PR adds a new Confidence Score: 5/5Safe to merge; all findings are P2 and doc-only. No P0 or P1 findings. The single P2 comment addresses reversed error-handling order in a TypeScript code example that operators may copy. The broader content is accurate and clearly scoped. docs/source/deployment/authentication.md — the Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant UI as AIQ UI (NextAuth)
participant Backend as AIQ Backend (AuthMiddleware)
participant Tool as Custom AIQ Tool
participant Downstream as Downstream API / MCP Server
User->>UI: Sign in (OAuth/OIDC)
UI->>UI: Store session, set idToken cookie
User->>Backend: Request (Bearer token or idToken cookie)
Backend->>Backend: JWTValidator validates token
Backend->>Tool: Execute tool (token in request context)
Tool->>Tool: get_auth_token()
Tool->>Downstream: HTTP call with Authorization: Bearer token
Downstream-->>Tool: Response
Tool-->>Backend: Tool result
Backend-->>User: API response
Reviews (2): Last reviewed commit: "docs: address greptile review on PR 212" | Re-trigger Greptile |
Three doc-only fixes flagged by greptile-apps[bot]: 1. mcp-tools.md (line 245): clarify that `call_internal_search` is a user placeholder, with an httpx.AsyncClient example showing the real call shape readers should substitute. 2. authentication.md (line 54): add inline comment warning that `MY_SSO_CLIENT_SECRET` MUST be set — `|| ''` silently substitutes an empty string and causes opaque OAuth failures at runtime. 3. authentication.md (line 220): same placeholder clarification as (1) for `call_internal_service`. No behavior changes; comments only.
…-AI-Blueprints#212) * add authentication guide and rewrite MCP tools docs - New deployment/authentication.md covering OAuth/OIDC sign-in, backend JWT validation, AIQ token usage in tools, and pass-through to MCP integrations. - Rewrite customization/mcp-tools.md around the NAT 1.6 MCP surface: mcp_client, mcp_service_account, native per-user MCP OAuth, AIQ token pass-through patterns, and publishing AIQ as an MCP server. - Wire both pages into the deployment and top-level docs indexes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Ajay Thorve <athorve@nvidia.com> * docs: scope MCP guide to AIQ 2.1 patterns Restructure docs/source/customization/mcp-tools.md around what AIQ 2.1 actually supports out of the box, instead of walking through workaround recipes for flows the blueprint does not yet integrate end to end. Supported patterns (kept as full walkthroughs): - mcp_client for unauthenticated MCP servers - mcp_service_account (incl. dual-auth example) for backend-credential MCP - AIQ-user-identity tools using aiq_agent.auth.get_auth_token() - nat mcp serve / nat fastmcp server run for publishing AIQ as MCP Deferred to AIQ 2.2 / 2.3 (kept as a short, honest planning note): - Per-user MCP OAuth driven by the AIQ UI. NAT 1.6 ships the protocol-level building blocks (mcp_oauth2, per_user_mcp_client) but AIQ 2.1 lacks the UI controls, the per-MCP auth-status surface on /v1/data_sources, and the async-job worker-side per-user MCP token resolution required to deliver this end to end. - A first-party AIQ-token pass-through MCP auth provider. Today this requires implementing a custom NAT auth provider in your deployment package; AIQ does not ship one. Cuts: - The three "Options 1/2/3" pass-through recipes collapse to a single "Forwarding AIQ User Identity from a Tool" section with the working internal_search example. - The long native per-user OAuth walkthrough (Jira example, redirect URI setup) is replaced by a short note pointing at the NAT MCP auth guide. - The "Does AIQ Need Separate UI Login..." combinatorial table. - The custom-provider Python skeleton for aiq_user_token_passthrough (the doc no longer recommends a flow AIQ does not provide out of the box). Net: 395 lines, down from 622. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Ajay Thorve <athorve@nvidia.com> * docs: address greptile review on PR 212 Three doc-only fixes flagged by greptile-apps[bot]: 1. mcp-tools.md (line 245): clarify that `call_internal_search` is a user placeholder, with an httpx.AsyncClient example showing the real call shape readers should substitute. 2. authentication.md (line 54): add inline comment warning that `MY_SSO_CLIENT_SECRET` MUST be set — `|| ''` silently substitutes an empty string and causes opaque OAuth failures at runtime. 3. authentication.md (line 220): same placeholder clarification as (1) for `call_internal_service`. No behavior changes; comments only. --------- Signed-off-by: Ajay Thorve <athorve@nvidia.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…intainer skills DEVSKILLS-8 (under epic AIQ-3362) tracks later maintainer skills until their surfaces stabilize or become active release work. Two of those gates have now opened, so these skills move from the backlog into the set: - aiq-customize-prompts-models: prompt/model customization became active release work in 2.2 (per-agent LLM role fields orchestrator_llm/source_router_llm/ researcher_llm/planner_llm/writer_llm via NVIDIA-AI-Blueprints#267, plus the documented Jinja2 prompt templates and swapping-models guide). Routes editing src/aiq_agent/agents/*/prompts/*.j2 and assigning LLMs per role in the llms section and agent config. - aiq-maintain-ci: CI/governance became active release work (4 workflows, contributor governance setup, the skill-eval regression gate, copy-pr-bot mirroring, and an expanded pre-commit hook set). Routes changes to .github/workflows, .pre-commit-config.yaml, CODEOWNERS, .coderabbit.yaml, and the .github/skill-eval harness. Each skill is a SKILL.md plus two references and a .claude/skills compatibility symlink, following the existing maintainer-skill conventions. The other two DEVSKILLS-8 skills stay deferred: aiq-auth-data-source-integration (protected- source UX/API deferred to 2.2/2.3 per PR NVIDIA-AI-Blueprints#212) and aiq-ui-change (2.2 UI auth controls not yet settled). Doc example listings (agent-skills.md table, README) that enumerate maintainer skills are reworked in the separate PR NVIDIA-AI-Blueprints#281; kept disjoint here. Validation: scripts/validate_skills.py (8 skills OK), pytest tests/test_agent_skills.py (4 passed), and pre-commit (detect-secrets, validate-skills, markdown-link-check) on the new files all pass. Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
) * feat(skills): add aiq-customize-prompts-models and aiq-maintain-ci maintainer skills DEVSKILLS-8 (under epic AIQ-3362) tracks later maintainer skills until their surfaces stabilize or become active release work. Two of those gates have now opened, so these skills move from the backlog into the set: - aiq-customize-prompts-models: prompt/model customization became active release work in 2.2 (per-agent LLM role fields orchestrator_llm/source_router_llm/ researcher_llm/planner_llm/writer_llm via #267, plus the documented Jinja2 prompt templates and swapping-models guide). Routes editing src/aiq_agent/agents/*/prompts/*.j2 and assigning LLMs per role in the llms section and agent config. - aiq-maintain-ci: CI/governance became active release work (4 workflows, contributor governance setup, the skill-eval regression gate, copy-pr-bot mirroring, and an expanded pre-commit hook set). Routes changes to .github/workflows, .pre-commit-config.yaml, CODEOWNERS, .coderabbit.yaml, and the .github/skill-eval harness. Each skill is a SKILL.md plus two references and a .claude/skills compatibility symlink, following the existing maintainer-skill conventions. The other two DEVSKILLS-8 skills stay deferred: aiq-auth-data-source-integration (protected- source UX/API deferred to 2.2/2.3 per PR #212) and aiq-ui-change (2.2 UI auth controls not yet settled). Doc example listings (agent-skills.md table, README) that enumerate maintainer skills are reworked in the separate PR #281; kept disjoint here. Validation: scripts/validate_skills.py (8 skills OK), pytest tests/test_agent_skills.py (4 passed), and pre-commit (detect-secrets, validate-skills, markdown-link-check) on the new files all pass. Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com> * docs(skills): fix accuracy issues in the two new maintainer skills Address PR #282 review feedback; every change verified against the repo. aiq-maintain-ci: - pytest and helm-lint are pre-commit `stages: [push]`, so `pre-commit run --all-files` does NOT run them (the prior "can be heavier than expected" note was backwards). Document `--hook-stage push` and that CI runs them as the dedicated test/helm-lint jobs; note the pre-commit job's SKIP= set. - Correct ui.yml job ids (install/lint/type-check/unit-test/build); name the skills-eval stages (detect-changes -> generate-datasets, which is creds-free -> harbor-eval); drop the tangential aiq-add-tool from Related Skills. aiq-customize-prompts-models: - The LLMProvider.configure(LLMRole.X) role binding is the deep-researcher pattern (add a field->role table: ORCHESTRATOR/ROUTER/RESEARCHER/PLANNER/ REPORT_WRITER); the clarifier passes planner_llm to its constructor instead. Unset deep-research roles fall back to orchestrator_llm (no generic `llm` field). Add source_router_llm to the example. - Adding a NEW template needs a one-line load_prompt wiring in the agent (prompts.md Step 3); soften "without changing agent code". Note prompts.md does not document every template's variables (source_router/writer/ source_registry) -- the .j2 files are authoritative. both: - Validation smoke must pass `--config_file <your config>` (a bare start_cli.sh runs the fixed default config); scope pytest to the agent's test dir. Validation: validate_skills.py (8 OK), pytest tests/test_agent_skills.py (4 passed), pre-commit (detect-secrets, validate-skills, markdown-link-check) on the changed files all pass. Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com> * docs(skills): list the two new skills in the maintainer skill tables Now that #281 has merged, enumerate aiq-customize-prompts-models and aiq-maintain-ci alongside the other four maintainer skills in the .agents/skills/README.md and docs/source/integration/agent-skills.md examples tables, and add their .claude/skills symlinks to the documented symlink block. Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com> * docs(skills): warn against hardcoding queries/domains in prompts Address review feedback on aiq-customize-prompts-models: add guidance that prompt templates must stay task-agnostic and not hard-code specific queries, domains, or source/tool names, since source/domain selection is data-driven via the data_source_registry and source_router.j2. Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com> --------- Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com> Co-authored-by: Chantal D Gama Rose <cdgamarose@nvidia.com>
Summary
Two doc-only commits in the customization + deployment areas:
docs/source/deployment/authentication.md— operator-facing guide covering OAuth/OIDC sign-in, backend JWT validation, AIQ user-token use in tools, AIQ-token pass-through to MCP integrations, headless API caller pattern, and troubleshooting.docs/source/customization/mcp-tools.md— scoped tightly to what AIQ 2.1 actually supports end-to-end.Both docs are wired into the deployment and top-level indexes.
What the MCP guide now covers
Supported patterns (full walkthroughs):
mcp_clientfor unauthenticated MCP serversmcp_service_account(incl. dual-auth) for backend-credential MCPaiq_agent.auth.get_auth_token()nat mcp serve/nat fastmcp server runfor publishing AIQ as MCPDeferred to AIQ 2.2 / 2.3 (short, honest planning notes):
mcp_oauth2,per_user_mcp_client) but AIQ 2.1 lacks the UI controls, the per-MCP auth-status surface on/v1/data_sources, and the async-job worker-side per-user MCP token resolution required to deliver this end-to-end.Cuts vs. the previous draft
Forwarding AIQ User Identity from a Toolsection with the workinginternal_searchexample.aiq_user_token_passthrough(the doc no longer recommends a flow AIQ does not ship out of the box).Net for
mcp-tools.md: 395 lines, down from 622 in the prior draft.Test plan
Notes
deployment/index.md, not introduced here.🤖 Generated with Claude Code