@@ -137,7 +137,7 @@ Always validate the delegated token to confirm the broker actually narrowed it:
137137``` python
138138from agentwrit import validate
139139
140- result = validate(broker_url, delegated.access_token)
140+ result = validate(app. broker_url, delegated.access_token)
141141assert result.valid
142142assert result.claims.scope == [" read:data:partition-7" ]
143143# partition-8 is NOT in the delegated token
@@ -179,7 +179,7 @@ delegated_ab = agent_a.delegate(
179179
180180# Hop 2: Use the delegated token to delegate further (raw HTTP)
181181resp = httpx.post(
182- f " { broker_url} /v1/delegate " ,
182+ f " { app. broker_url} /v1/delegate " ,
183183 json = {
184184 " delegate_to" : agent_c.agent_id,
185185 " scope" : [" read:data:partition-7" ],
@@ -259,7 +259,7 @@ For zero-trust enforcement, validate the token with the broker AND check scope:
259259``` python
260260from agentwrit import validate, scope_is_subset
261261
262- result = validate(broker_url, agent.access_token)
262+ result = validate(app. broker_url, agent.access_token)
263263if result.valid and result.claims:
264264 # Token is live — now check scope
265265 if scope_is_subset(required_scope, result.claims.scope):
@@ -351,7 +351,7 @@ If someone sends a fake token to your app, `validate()` handles it gracefully:
351351``` python
352352from agentwrit import validate
353353
354- result = validate(broker_url, " completely-fake-not-a-jwt" )
354+ result = validate(app. broker_url, " completely-fake-not-a-jwt" )
355355print (result.valid) # False
356356print (result.error) # "token is invalid or expired"
357357```
@@ -406,7 +406,7 @@ Same behavior, but uses the app's broker URL and timeout.
406406### ValidateResult Fields
407407
408408``` python
409- result = validate(broker_url, agent.access_token)
409+ result = validate(app. broker_url, agent.access_token)
410410
411411if result.valid:
412412 print (result.claims.iss) # "agentwrit"
0 commit comments