Skip to main content

Audit Logs

Audit logs record security-relevant activity in a Qefro organization. Identity audit records channel identity resolution and Customer Access Service challenges without storing OTP codes or JWTs. Tool execution logs record each Business Action — which tool ran, when, and with what outcome.

Together they answer “who changed configuration?”, “how was this customer authenticated?”, and “what did the assistant call?”

Short definition (citation-ready)

Qefro exposes organization audit logs for administrative events, identity audit for channel/auth decisions (with secrets stripped), and per-tool execution logs for Business Actions, so teams can investigate configuration changes, identity challenges, and AI-initiated API traffic.

Three log streams

StreamAnswersTypical consumers
Org audit logsWho invited users, changed RBAC, updated org settings, revoked sessions?Security, Admins
Identity auditWas identity resolved? Did a challenge start/succeed/fail? Was a tool blocked for auth level?Security, Support leads
Tool execution logsWhich Business Tool ran during chat? Success or error?Engineering, Support leads

Org audit actions (implemented)

These action names are written to org_audit_logs (tenant-scoped):

ActionTypical resource
create_team / update_team / delete_teamTeam
set_team_members / set_team_member_writeTeam membership
set_team_workspaces / set_workspace_teamsWorkspace grants
invite_member / accept_invitation / revoke_invitationInvitation
remove_member / change_member_roleMember
suspend_member / reactivate_memberMember status
transfer_ownershipOrganization
update_org_settingsOrganization
revoke_sessionSession

Entries include actor user id when known, resource type/id, JSON details, and optional client IP / User-Agent from X-Forwarded-For / User-Agent.

Identity audit (no secrets)

Identity audit events include identity_resolved, challenge_started, verification_success, verification_failure, session_created, and tool_auth_blocked.

The logger removes these keys from detail payloads before persist: otp, code, token, jwt, password, secret, authorization. Emails are stored as hints/masks, not as full OTP delivery.

Architecture

API surfaces

GET/api/v1/org/audit-logs

List organization audit events for the authenticated tenant (Owner/Admin).

GET/api/v1/tools/:tool_id/logs

List recent execution attempts for a specific Business Tool.

curl -sS -H "Authorization: Bearer $USER_JWT" \
https://api.qefro.com/api/v1/org/audit-logs

curl -sS -H "Authorization: Bearer $USER_JWT" \
https://api.qefro.com/api/v1/tools/$TOOL_ID/logs

Exact fields evolve with the product; use the Admin Console views during pilots and the API for automation.

Investigation workflow

Investigate an unexpected tool call

  1. Identify the workspace and channelWidget, portal, or WhatsApp?
  2. Pull tool execution logsConfirm time, tool id, and error/success.
  3. Check identity auditWas the caller verified_channel or challenged?
  4. Check who configured the toolOrg audit logs for credential, RBAC, or SDK UI changes.
  5. ContainDisable write tools, rotate secrets, split workspaces if needed.

What to log on your side

Qefro logs the action attempt. Your API should still log:

  • Authenticated end-user id (from forwarded identity headers or your Access Service)
  • Resource ids touched
  • Authorization allow/deny decisions

That dual trail is what incident response needs.

Best practices

  • Review tool logs weekly during the first month of any new Business Action
  • Alert on bursts of failures (often bad credentials or SSRF blocks)
  • Retain exports according to your compliance policy — do not assume infinite retention
  • Treat conversation transcripts as potentially sensitive if tools return PII

FAQ

Are prompts fully stored in audit logs?
Audit and tool logs focus on administrative and execution metadata. Conversation content is handled in the conversation subsystem — review retention with your security team. See Data handling.
Can Members read org audit logs?
Audit APIs are intended for Owner/Admin roles. Members use granted workspaces for Employee AI chat.
Do WhatsApp messages appear in tool logs?
Only if a Business Action runs. Channel messages are conversations; tool logs appear when tools execute. Identity audit may record verification events for that conversation.
Does identity audit store OTP codes?
No. OTP, JWT, and password fields are stripped. Qefro forwards challenge replies to your Customer Access Service; your service verifies them.