# Path 2: JWS with claims (JavaScript)

**Question:** "Is this agent authorized by a human, and does that human meet these criteria (age, nationality, AML)?"

The agent sends a ProofPack proof as **JWS or JWT** in the standard `Authorization: Bearer <token>` header. Your service verifies it and reads the revealed claims.

```javascript
import { AttestedMerkleExchangeReader } from '@zipwire/proofpack';

const reader = new AttestedMerkleExchangeReader();

const result = await reader.readAsync(
  jws,  // From Authorization: Bearer <JWS>
  verificationContext
);

if (result.isValid) {
  const claims = result.document.merkleTree.leaves;

  // Use verified claims
  if (claims.nationality === 'UK' && claims.age >= 18) {
    // Process the request
    const agent = {
      wallet: result.agentWallet,
      human: result.humanWallet,
      authorizedAt: result.delegationDate,
      claims: claims
    };

    await processRequest(agent);
  }
}
```

You must configure `verificationContext` (trusted roots, schemas). See [Quick setup: verification context](https://docs.zipwire.io/tools-and-integrations/proofpack-agent-delegation/quick-setup-verification-context) and [ProofPack & Agent Delegation](https://docs.zipwire.io/tools-and-integrations/proofpack-agent-delegation).
