{"agent":"codex","input":"Add CSRF protection to this Fastify API and open a pull request. Read package.json, src/server.ts, src/app.ts, src/plugins/external/session.ts, src/plugins/external/env.ts, src/routes/api/autohooks.ts, src/routes/api/auth/index.ts, src/routes/api/tasks/index.ts, src/routes/api/users/index.ts, test/helper.ts, test/routes/api/tasks/tasks.test.ts and .github/workflows/ci.yml first. Add @fastify/csrf-protection as src/plugins/external/csrf.ts registered with sessionPlugin '@fastify/session' and declared as depending on the session plugin. Add GET /api/csrf returning reply.generateCsrf(). In src/routes/api/autohooks.ts add a preHandler that runs fastify.csrfProtection for every method except GET, HEAD and OPTIONS. Extend the login and injectWithLogin helpers in test/helper.ts to fetch a token from /api/csrf and send it as the x-csrf-token header so the existing tests pass unchanged. Add test/app/csrf.test.ts: a POST /api/tasks with a session but no token is 403, with a token it succeeds, and with a token from another session it is 403. Use node:test and assert like the existing tests. Run npm run lint, npm run build -- --noEmit and npm test against MySQL from docker-compose.yml with RATE_LIMIT_MAX=4, and paste the test summary in the pull request. Do not change the session cookie settings or the login route.","resources":[{"url":"https://github.com/your-org/your-app"}]}