Menu

1 / 2

Every rejection leaves a trail, persistent log of rejected attempts

DEV Community·João André Gomes Marques·6 months ago
#mBMk6Jcf
#ai#python#security#agent#endpoint
Reading 0:00
15s threshold

A rejection is data. Until last week we were throwing it away.

If an attacker submitted a forged signature against the public verify endpoint, we returned 404 signature_not_found and that was the entire footprint. Same for a cross-org access attempt on the replay endpoint, an agent that got suspended mid-run trying to sign once more, or a probe walking through random sig_* ids.

An older trust-data-infrastructure project we read during a cold audit is explicit about this: log every invocation including the invalid ones, "para auditoria futura". It is the right call. We borrowed it.

What landed

One new table, rejected_attempts . Indexed on (organization_id, created_at) and (agent_id, created_at) for fast org-scoped time-window scans.

One helper, log_rejected_attempt(db, request, endpoint, failure_reason, ...) . Captures IP, User-Agent, X-Request-ID. Truncates user-supplied bytes. Commits its own row.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.