Skip to content

Commit 11f058c

Browse files
committed
ok
1 parent 58603b1 commit 11f058c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/content/docs/agents/api-reference/calling-agents.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ When building and deploying Agents using the Agents SDK, you will often want to
107107
As best practices:
108108

109109
* Handle authentication in your Workers code, before you invoke your Agent.
110-
* Use the built-in hooks when using the `routeAgentRequest` helper - `on
111-
* Use your preferred router (such as Hono) and authentication middleware or provider to apply custom authentication schemes before calling an Agent.
110+
* Use the built-in hooks when using the `routeAgentRequest` helper - `onBeforeConnect` and `onBeforeRequest`
111+
* Use your preferred router (such as Hono) and authentication middleware or provider to apply custom authentication schemes before calling an Agent using other methods.
112112

113113
The `routeAgentRequest` helper documented earlier in this guide exposes two useful hooks (`onBeforeConnect`, `onBeforeRequest`) that allow you to apply custom logic before creating or retrieving an Agent:
114114

@@ -184,6 +184,7 @@ app.get('/code-review/:id', async (c) => {
184184

185185
</TypeScriptExample>
186186

187+
This ensures we only create Agents for authenticated users, and allows you to validate Agent names conform to your preferred naming scheme before instances are created.
187188

188189
### Next steps
189190

0 commit comments

Comments
 (0)