Skip to content

feat(dojo): support Authorization header for the agno integration#2132

Open
Himanshu040604 wants to merge 2 commits into
ag-ui-protocol:mainfrom
Himanshu040604:feat/dojo-agno-auth-header
Open

feat(dojo): support Authorization header for the agno integration#2132
Himanshu040604 wants to merge 2 commits into
ag-ui-protocol:mainfrom
Himanshu040604:feat/dojo-agno-auth-header

Conversation

@Himanshu040604

@Himanshu040604 Himanshu040604 commented Jul 7, 2026

Copy link
Copy Markdown

What

Adds an opt-in AGNO_AUTH_TOKEN env var to the dojo's agno integration. When set, every dojo→agno request carries Authorization: Bearer <token>. When unset, behavior is byte-identical to today.

Fixes #2130

Why

Agno v2.7 (agno-agi/agno#8747) put agno's AG-UI endpoint behind AgentOS's central auth middleware, so deployments using OS_SECURITY_KEY, JWT auth, or platform access tokens now return 401 to anonymous requests. The dojo builds its AgnoAgent instances from AGNO_URL alone — there is no way to attach a credential — which means the stock dojo cannot connect to any secured agno backend. This PR closes that gap with a single opt-in env var, while unsecured setups keep working exactly as before.

We chose this approach because the SDK already supports it end-to-end — no new machinery needed (agno#8747 review):

Note the SDK already supports this: HttpAgent (which AgnoAgent extends) accepts headers in its config […] We need to update the dojo demo app to add the env plumbing, which is a one-line change there.

Design

  • Follows the watsonx credential pattern (#1665): env var read in env.ts with an || "" default, consumed in the agents.ts factory.
  • No SDK or integration-package changes — HttpAgent already sends configured headers on every request; @ag-ui/agno stays a thin subclass.
  • agents.ts is server-only and the var is not NEXT_PUBLIC_-prefixed, so the token never reaches the browser.

Testing

No sidebar feature is added, so no new e2e suite per CONTRIBUTING. Verified instead (Node 22, pnpm 10.33.4):

Check Result
pnpm run build (nx, 34 projects) ✅ pass
pnpm generate-content-json + git diff --exit-code src/files.json ✅ unchanged
Root pnpm run test ✅ 31/32 — sole failure is @ag-ui/cross-language-tests, which needs a local .NET SDK and fails identically on unmodified main
agno Playwright e2e (tests/agnoTests, 10 tests) with AGNO_AUTH_TOKEN unset ✅ 10/10 — no-op regression proof

Live against agno v2.7.0:

Backend Dojo Result
OS_SECURITY_KEY set no token HTTP 401 {"detail":"Authorization header required"}
OS_SECURITY_KEY set AGNO_AUTH_TOKEN set ✅ chat streams normally
open (no key) no token ✅ identical to today

Agno v2.7 can place its AG-UI endpoint behind AgentOS auth middleware,
so secured backends reject the dojo's anonymous requests. Add an opt-in
AGNO_AUTH_TOKEN env var: when set, the dojo's AgnoAgent instances send
Authorization: Bearer <token>; when unset, behavior is unchanged.

Fixes ag-ui-protocol#2130
Copilot AI review requested due to automatic review settings July 7, 2026 19:31
@Himanshu040604
Himanshu040604 requested a review from a team as a code owner July 7, 2026 19:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds optional auth-token plumbing to the Dojo’s Agno integration so the Dojo can connect to secured Agno/AgentOS deployments by sending a Bearer Authorization header on all Dojo→Agno requests when configured.

Changes:

  • Introduces AGNO_AUTH_TOKEN in Dojo env parsing with an empty-string default (no-op when unset).
  • Passes Authorization: Bearer <token> via AgnoAgent/HttpAgent headers config only when the token is set.
  • Documents the Dojo auth env var in the @ag-ui/agno TypeScript README.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
integrations/agno/typescript/README.md Documents AGNO_AUTH_TOKEN usage for running Dojo against secured Agno/AgentOS.
apps/dojo/src/env.ts Adds agnoAuthToken to Dojo env var parsing with a safe default.
apps/dojo/src/agents.ts Conditionally injects an Authorization header into AgnoAgent construction.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread integrations/agno/typescript/README.md Outdated

## Dojo

To run the [dojo](https://github.com/ag-ui-protocol/ag-ui/tree/main/apps/dojo) against a secured AgentOS (e.g. `OS_SECURITY_KEY`, JWT middleware, or platform access tokens), set `AGNO_AUTH_TOKEN` — every agno request will then carry an `Authorization: Bearer` header:
Spell out the full Authorization: Bearer <token> value in the dojo
note so the literal 'Bearer' string isn't read as the header value.
Addresses Copilot review feedback on ag-ui-protocol#2132.
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.

[Feature]: dojo agno integration — support Authorization header via env var

2 participants