Skip to content

docs: add authentication guide and scope MCP guide to AIQ 2.1 - #212

Merged
cdgamarose-nv merged 3 commits into
NVIDIA-AI-Blueprints:developfrom
AjayThorve:fix/performance-ui
May 4, 2026
Merged

docs: add authentication guide and scope MCP guide to AIQ 2.1#212
cdgamarose-nv merged 3 commits into
NVIDIA-AI-Blueprints:developfrom
AjayThorve:fix/performance-ui

Conversation

@AjayThorve

Copy link
Copy Markdown
Member

Summary

Two doc-only commits in the customization + deployment areas:

  1. New 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.
  2. Rewrite 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_client for unauthenticated MCP servers
  • mcp_service_account (incl. dual-auth) 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 (short, honest planning notes):

  • 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.

Cuts vs. the previous draft

  • 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 reference.
  • The "Does AIQ Need Separate UI Login..." combinatorial table.
  • A custom-provider Python skeleton for 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

  • Docs build cleanly (sphinx)
  • Doc-tree TOC includes the new authentication.md
  • All cross-references between mcp-tools.md and authentication.md resolve

Notes

  • Doc-only PR; no code changes.
  • Markdown-link-checker may flag external sites that 403 the bot UA (FastAPI, Dask, Next.js, Postgres, LangGraph) — these were pre-existing in deployment/index.md, not introduced here.
  • Follow-ups for AIQ 2.2 / 2.3 (per-user MCP OAuth UI, async-job auth refresh) are tracked separately under the auth/MCP umbrellas.

🤖 Generated with Claude Code

AjayThorve and others added 2 commits May 3, 2026 23:47
- 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>
@AjayThorve
AjayThorve force-pushed the fix/performance-ui branch from c281b25 to 622e8b2 Compare May 4, 2026 06:47
@greptile-apps

greptile-apps Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This doc-only PR adds a new authentication.md operator guide and rewrites mcp-tools.md to accurately reflect what AIQ 2.1 supports end-to-end. Both files are correctly wired into the Sphinx toctrees. The content is well-structured, cross-references between the two guides resolve correctly, and the decision to defer per-user MCP OAuth to 2.2/2.3 is clearly communicated.

Confidence Score: 5/5

Safe 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 refreshMySSOToken example snippet has a minor error-handling order issue.

Important Files Changed

Filename Overview
docs/source/deployment/authentication.md New operator-facing auth guide covering OAuth/OIDC UI setup, JWT backend validation, data-source gating, and headless API callers. The refreshMySSOToken code example calls .json() before checking response.ok, breaking error handling for non-JSON error responses.
docs/source/customization/mcp-tools.md Substantial rewrite scoping the guide to AIQ 2.1-supported patterns; adds service-account auth, user-identity forwarding, per-user OAuth planning notes, and troubleshooting sections.
docs/source/deployment/index.md Adds a bullet entry linking to the new authentication.md; change is minimal and correct.
docs/source/index.md Wires authentication.md into the top-level Sphinx toctree in the correct position within the Deployment section.

Sequence Diagram

sequenceDiagram
    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
Loading

Reviews (2): Last reviewed commit: "docs: address greptile review on PR 212" | Re-trigger Greptile

Comment thread docs/source/customization/mcp-tools.md
Comment thread docs/source/deployment/authentication.md
Comment thread docs/source/deployment/authentication.md
@AjayThorve AjayThorve added documentation Improvements or additions to documentation AIQ2.1 labels May 4, 2026
@AjayThorve
AjayThorve requested a review from cdgamarose-nv May 4, 2026 21:20
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.
@AjayThorve

Copy link
Copy Markdown
Member Author

@greptileai

@cdgamarose-nv cdgamarose-nv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@cdgamarose-nv
cdgamarose-nv merged commit 1d2fa4c into NVIDIA-AI-Blueprints:develop May 4, 2026
4 checks passed
taylorjordanNC pushed a commit to taylorjordanNC/rh-research that referenced this pull request May 27, 2026
…-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>
zhongxuanwang-nv added a commit to zhongxuanwang-nv/aiq that referenced this pull request Jun 24, 2026
…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>
cdgamarose-nv added a commit that referenced this pull request Jun 25, 2026
)

* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants