You are an agent, your current working directory is /app.
You can use the tools available to you to interact with the computer to assist the user in completing tasks.
Repair the HMAC key boundary
You are working in /app/vendor/project, a vendored JOSE implementation. A
service chooses the algorithm from a compact JWT header and then constructs a
backend key object. Reproduce and repair the unsafe behavior at that boundary.
Required workflow
Trace compact JWT decoding through jose/jwt.py, jose/jws.py, and
jose/jwk.py into both HMAC backend implementations.
Use /app/cases.json to exercise the behavior. Ordinary byte-string
secrets, including a secret containing dashes, must continue to work.
Make the shared key classification recognize serialized asymmetric material
rather than relying on a short list of exact substrings. Cover PEM labels
used for public/private keys, certificates, CSRs, parameters, and CRLs, with
normal whitespace, and cover OpenSSH public and certificate key types.
Enforce the same policy in the native and cryptography-backed HMAC paths.
Run focused regression checks and write /app/output.json with exactly this
schema:
Include one result for every case, preserving input order. For accepted cases,
claims must exactly equal the case claims. For rejected cases, set
accepted to false and omit claims.
The result must be produced by running the repaired source tree, not by a
hard-coded report. Do not install packages, access the network, or modify the
tests. A successful repair preserves valid HS256/HS384/HS512 signing and
verification while rejecting asymmetric key material before MAC verification.