Skip to content

Threat-detection model usage is invisible to token-usage artifacts and AI-credits accounting #54046

Closed

Description

@theletterf

Follow-up to #54045. While that detection job spent ~20 minutes making billed model calls (gh-aw v0.86.2, firewall v0.27.44, codex engine), none of that usage surfaced anywhere gh-aw reports:

  • The run's usage artifact contained detection/token_usage.jsonl with zero entries, while agent/token_usage.jsonl correctly recorded 14 requests.
  • The detection artifact contained only detection.log — no firewall or api-proxy logs for the detection phase, unlike the agent artifact which includes sandbox/firewall/logs/**.
  • The run's AI-credits number (aic in agentic-workflow-usage-cache.jsonl) was 5.8 — the agent's usage only. Our provider dashboard showed several times that, and the delta was the looping detection job.

The practical consequence: threat-detection has its own budget (GH_AW_DEFAULT_DETECTION_MAX_AI_CREDITS, default 400), but if the tracker records nothing for the detection phase, that cap has nothing to act on — a runaway detection can spend unboundedly while every gh-aw-side report says the run was cheap.

Asks:

  • Record detection-phase requests in the usage artifact the same way agent-phase requests are recorded.
  • Include the detection job's firewall/api-proxy logs in the detection artifact.
  • Count detection usage toward the run's AI credits so the detection budget cap is enforceable.

Activity

  1. locked and limited conversation to collaborators on Aug 19, 2026
  2. unlocked this conversation on Aug 19, 2026
  3. pelikhan commented on Aug 20, 2026

    @pelikhan
    Collaborator

    @copilot check this issue in the context of now using gh-aw-detection as the default engine for detection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions