Rollout & operations · SealGate
Using a passkey audit log: what to record and how to investigate
5 min read
Key points
- Record event type, result, user, credential, timestamp, caller and failure details, and never record secrets such as signatures or session values.
- Use it to investigate sign-in problems, spot failure spikes or unrecognized registrations, and trace who revoked a key or changed a setting.
- Decide on tamper detection, access restrictions and retention, and unlink records from users who close their accounts.
A passkey audit log is a chronological record of registrations, sign-ins, revocations and settings changes: when, for whom, what, and whether it succeeded. Day to day it has three uses: finding the cause of "I can't sign in" tickets, noticing signs of abuse such as failure spikes or registrations the user does not recognize, and confirming later who revoked a key or changed a setting. Keep secrets such as signatures and session values out of it, and decide on retention and who can read it.
What to record
The OWASP Logging Cheat Sheet recommends recording "when, where, who and what" for each event, and always logging authentication successes and failures. For passkeys, record these fields per event:
| Field | Example | Used for |
|---|---|---|
| Event type | Registration completed or failed, sign-in succeeded or failed, credential revoked, recovery issued, setting changed | Filtering, counting |
| Result | Success / failure | Spotting failure spikes |
| User | Internal user ID | Support investigations |
| Credential | Passkey ID | Identifying which device's key |
| Timestamp | UTC | Lining up events |
| Caller | IP address, User-Agent | Clues about device and route |
| Details | Failure reason, recovery reason, staff member who acted | Finding the cause |
Use UTC and keep server clocks synchronized. OWASP also calls for synchronized time across servers and devices so events can be correlated.
What never to record
OWASP says secrets such as session identifiers, access tokens, passwords and encryption keys should be removed, masked or encrypted before logging. For passkeys, do not record:
- The authenticator's response body (signature, clientDataJSON, authenticatorData)
- Session cookies or tokens issued after sign-in
- Recovery token values
- API keys
You also do not need email addresses or names in the audit log. Keep the internal user ID and look the person up in your own database when needed. The less personal data spreads into logs, the easier access control and deletion requests become.
Reading it day to day
Investigating "I can't sign in"
Filter by user ID and read the latest events, newest first.
- A string of failed sign-ins: read the failure details. A revoked key, another user's key, an expired challenge and so on each call for different guidance.
- No records at all: the request never reached your service. Suspect browser support, the user canceling, or a UI bug.
- A long gap since the last success: the user may have changed devices and the passkey is not on the new one. Compare with the list of registered keys.
Spotting signs of abuse
These patterns are clues to account takeover:
- Sign-in failures increasing over a short period
- A passkey registration the user does not recognize (especially at unusual hours, or right after a password sign-in)
- Attempts to sign in with a revoked key
- A new key registered right after a recovery was issued
If you see these, move to what to do when you suspect account takeover.
Tracing who did what
Revoking keys, deleting users, issuing recovery and changing settings are actions taken by support or engineering staff. Without a record of who did what and when, you cannot tell a mistake from abuse. Log staff actions in the same audit log as user actions.
Retention and protection
OWASP recommends tamper detection, restricting and auditing access to logs, and retaining logs for the required period without deleting them early.
- Retention: abuse can take a while to notice. If internal policy or contracts set a period, follow it.
- Access: limit audit log access to support and security staff.
- Account closure and deletion requests: when a user leaves, mask or delete the fields that link records to them. Counts and timestamps are enough for aggregates and trend analysis.
SealGate's audit log
SealGate keeps an audit log per environment (app). In the dashboard, the Audit log page lists registrations, sign-ins, revocations and settings changes, lets you filter by type and date, and exports to CSV. It does not record signatures or key material, and records are kept for 90 days (up to 365 days per organization on request).
Over the API, use GET /v1/apps/{app_id}/audit:
curl "https://api.sealgate.jp/v1/apps/app_.../audit?event=login.failed&since=2027-02-01T00:00:00Z&limit=200" \
-H "Authorization: Bearer sk_live_..."| Parameter | Meaning |
|---|---|
event |
Filter by type (login.succeeded and so on) |
since |
From this time (ISO 8601) |
limit |
Number of records (default 200, max 1000) |
Results are newest first, and each record has event, ok, end_user_id, credential_id, ip, user_agent, detail and at. ip and user_agent come from the request SealGate received. When your server relays calls from the browser SDK, these can be your server's values rather than the user's device, so record device information on your own server as well.
A few more things that help in practice:
- Up to 1,000 records per call. Results are newest first, so if you pull them into your own log pipeline, set
sinceto the time of your last pull and poll often enough to stay under the limit. To receive events as they happen, use webhooks (login.succeeded,login.failed,register.completedand others). - Settings changes are logged too. Actions such as
app.updated,api_key.createdandapi_key.revokedgo to the target environment's audit log. Actions over MCP (AI agents) are recorded with the person and the client name. - Record the reason for recovery. Put something like "identity verified by support" in
reasononPOST /v1/recovery/start, and it goes into the audit log. - Deleting a user masks their records.
DELETE /v1/users/{external_id}keeps counts and timestamps, setsend_user_idtodeleted, and clears the credential ID, IP, User-Agent anddetail. - Use stats for aggregates.
GET /v1/apps/{app_id}/statsreturns monthly MAU, registrations, sign-in successes and failures, users with passkeys, and a breakdown by transport (internal,hybrid,usband so on).
See Audit log and stats in the docs.
FAQ
Should the audit log be separate from application logs?
Yes. Application logs tend to be verbose for debugging and risk picking up secrets. Give the audit log a fixed set of fields and a short list of readers.
Should users be notified on every failure?
Notifying on every failure trains people to ignore alerts. Limit user notifications to important successful events such as a new passkey or a sign-in from a new device, and watch failure spikes on the operations side.
Sources
Related posts
Account security
New device sign-in alerts: which events to notify and what to write
Alerts for new passkeys, account recovery and sign-ins from unfamiliar devices help users catch takeovers early. What to notify, how to spot a new device, what to write.
Rollout & operations · Recovery & devices
A passkey FAQ for your support team: sample answers and checks
Sample answers your support team can give about passkeys, from new phones to \"does the site get my fingerprint?\", plus the checks staff should run before helping.
Rollout & operations
Prompting users to create a passkey after sign-in: timing, copy and \"not now\"
The best time to offer a passkey is right after sign-in. When to prompt and whom, what to say, how to handle \"not now,\" and where conditional create fits.