Skip to content

feat: support exporting compliance audit logs as CSV#438

Open
arcgod-design wants to merge 2 commits into
sreerevanth:mainfrom
arcgod-design:feat/issue-148-csv-export
Open

feat: support exporting compliance audit logs as CSV#438
arcgod-design wants to merge 2 commits into
sreerevanth:mainfrom
arcgod-design:feat/issue-148-csv-export

Conversation

@arcgod-design

Copy link
Copy Markdown
Contributor

Summary

  • Adds \ o_csv()\ method to \ComplianceReport\ for CSV export of audit denials
  • Adds \generate_csv()\ method to \ComplianceReporter\ with \include_allowed\ option
  • Adds CLI commands: \compliance export-csv\ (remote API) and \compliance export-local\ (local engine)
  • Adds 5 new tests for CSV export functionality

Changes

  • \�gentwatch/governance/compliance_reporter.py: Added \ o_csv()\ and \generate_csv()\ methods
  • \�gentwatch/cli/main.py: Added \compliance_app\ with \export-csv\ and \export-local\ commands
  • \ ests/test_compliance.py: Added 5 CSV export tests

Testing

All 5 CSV tests pass:

  • \ est_compliance_report_to_csv_has_header\
  • \ est_compliance_report_to_csv_contains_denials\
  • \ est_compliance_report_to_csv_empty_when_no_denials\
  • \ est_compliance_reporter_generate_csv_denials_only\
  • \ est_compliance_reporter_generate_csv_includes_allowed\

Closes

closes #148

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@arcgod-design, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 17 minutes and 32 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7a4cbf29-5432-49f1-8efa-0a178bb2930f

📥 Commits

Reviewing files that changed from the base of the PR and between 3b1f4b5 and 43e31d4.

📒 Files selected for processing (3)
  • agentwatch/cli/main.py
  • agentwatch/governance/compliance_reporter.py
  • tests/test_compliance.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sreerevanth

Copy link
Copy Markdown
Owner

@arcgod-design Thanks for the contribution.

Before merge, I'd like some clarification around the export source.

The CSV export functionality itself looks useful, but I want to ensure the exported report reflects actual compliance/audit findings rather than data generated from a fresh local compliance engine at export time.

Please clarify:

  • Where the exported records originate from
  • Whether the CLI exports persisted compliance history or generates a new report on demand
  • How the local export path maps to real audit findings

Also, let's wait for the remaining CI checks to complete before making a merge decision.

Once that's clarified and CI is green, I'll take another look.

@github-actions

Copy link
Copy Markdown

🧪 PR Test Results

Check Result
Tests (pytest tests/) ✅ success
Lint (ruff check .) ❌ failure
Coverage (agentwatch) 73.28%

Python 3.12 · commit 43e31d4

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] support exporting compliance audit logs as CSV

2 participants