Skip to content

Feature Request: Scan Cost and Token Usage Transparency #14

Description

@Nekenlight

Feature Request: Scan Cost and Token Usage Transparency

Summary

Add token usage and estimated cost reporting for Ponytail-Sec scans.

As repositories grow in size, security scans can consume a significant number of LLM tokens. Providing visibility into token consumption and estimated scan cost would help teams understand resource usage, optimize scan frequency, and measure the efficiency of security reviews.

Problem

Today, Ponytail-Sec provides high-value security findings, but users have no visibility into:

  • Total tokens consumed during a scan
  • Input vs output token usage
  • Estimated scan cost
  • Cost per finding
  • Cost evolution across multiple scans

For teams using paid LLM APIs, understanding scan cost becomes increasingly important as repositories grow and scans become part of CI/CD workflows.

Without this visibility it is difficult to:

  • Measure scan efficiency
  • Estimate operational cost
  • Compare repository scans
  • Optimize scanning frequency
  • Demonstrate ROI from security automation

Proposed Solution

After each scan, provide a lightweight cost summary.

Example:

Ponytail-Sec Scan Summary

Repository: my-service
Scan Mode: Audit

Input Tokens: 92,541
Output Tokens: 4,233
Total Tokens: 96,774

Estimated Cost: $0.84

Material Findings: 3

Cost per Finding: $0.28

Optional Enhancements

When scan history/versioning is available, display trends:

Scan #12
Cost: $0.84
Tokens: 96,774
Findings: 3

Scan #13
Cost: $0.52
Tokens: 61,205
Findings: 2

Delta:
-37% tokens
-38% cost
-1 finding

Benefits

  • Improves transparency.
  • Helps teams manage LLM spending.
  • Encourages efficient security workflows.
  • Enables better planning for CI/CD usage.
  • Allows users to evaluate scan ROI.
  • Aligns with Ponytail's philosophy of maximizing value while minimizing waste.

Potential Implementation

Store a small metadata block alongside each scan result:

{
  "timestamp": "2026-07-07T10:00:00Z",
  "input_tokens": 92541,
  "output_tokens": 4233,
  "estimated_cost": 0.84,
  "findings": 3
}

The implementation could remain lightweight and optional while providing valuable operational visibility for teams running scans regularly.

Additional Context

Ponytail and Ponytail-Sec focus on high-impact results with minimal noise.

Token and cost transparency would extend the same philosophy to scan execution itself, helping users understand not only what security improvements were found, but also the operational cost of discovering them.

Thank you for the project and the great work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions