Safeguard
Compliance•

CI run history expires: how to keep security metrics beyond it

CI platforms keep run data for a limited time. How to export security metrics as small durable records so trends and audit evidence outlive the logs.

Safeguard Security Team
4 min read

CI platforms keep run history and logs for a limited time, so a trend chart built on live queries will lose its past. Export a small, structured record per security job into storage you control, and keep it for as long as your own policy says.

Why this bites

Teams build a dashboard that queries the CI API directly. It works for months. Then someone asks for a year over year comparison, or an auditor asks for evidence from a past period, and the older runs are gone or only partly available.

Platforms set their own limits. GitHub's documentation, for example, states that a workflow run can be re-run up to 30 days after its initial run, which is one visible sign that run data is not meant as a permanent archive. Check your own platform's retention settings for logs and artifacts, and note that administrators may be able to change them.

What to export

Do not archive full logs. Store a compact record per security job.

FieldWhy
Run identifier and linkTo find the original while it exists
Repository and branch typeFor slicing
Commit identifierTo tie results to a change
Start, queue and end timesFor timing metrics
Outcome state and reason codeFor gate and failure metrics
Counts by severity or levelFor trends
Scanner, rule and data feed versionsTo explain shifts
Exception or override referenceFor audit trail

Keep the record free of secrets and personal data. Findings details can stay in the scanner's own store, and the record can link to them.

How to export

  1. Add a final step to the security job that writes the record as JSON.
  2. Send it to a store you control, such as a database table, object storage or a metrics system, with the same credentials discipline as any pipeline output.
  3. Make the step run even when the scan fails, otherwise the worst runs are missing from your history.
  4. Add a nightly job that backfills runs the export step missed, while the platform still has them.

If your CI platform exposes an API for run history, a scheduled collector is a good safety net.

Retention policy

Choose retention on purpose.

  • Operational metrics might need a year or two to show trends.
  • Audit evidence may need to cover your whole audit period plus a margin. Ask your auditor or compliance lead what applies to you, and do not guess.
  • Delete what you do not need, since stored data is also a liability.

Write the decision down with an owner and a review date.

Integrity

If records will serve as evidence, protect them from silent edits. Restrict who can write or alter them, log changes and keep timestamps from a trusted source. Evidence that anyone can quietly rewrite is weak evidence.

Quick check

Can't I just raise the platform retention?

That helps, but logs are bulky and may contain sensitive text. A compact exported record is cheaper and safer to keep for long periods.

Should failed scans be exported too?

Yes, especially. Missing failures make your history look healthier than it was.

How Safeguard fits

Safeguard includes compliance and evidence automation and continuous monitoring, so scan results and gate decisions can be kept as evidence tied to your controls. Try a free scan at gold.safeguard.sh/scan.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.