Including oauth in calls to tools

I have an agent that makes api calls on behalf of the the user of the agent. These api calls have been exposed as tools.

Prior to using the agent, the client app has already done an oauth to the end user. The bearer token is passed to the agent_os. How can I include that token in the calls to the tools/apis?

Hey @bencien, thanks for reaching out and supporting Agno. I’ve shared this with the team, we’re working through all requests one by one and will get back to you soon.If it’s urgent, please let us know. We appreciate your patience!

Hey @bencien

The two ways I can think of doing this via:

  • Either use our new JWT middleware or build your own that is really similar

  • The important part is that you use session_state_claims which will inject session_state into the agent, then they reference that in their tools.

See here https://docs.agno.com/agent-os/customize/middleware/jwt