| name | continuous-monitoring |
| description | Set up automated recurring code audits and optimization monitoring with cron jobs |
| version | 1.0.0 |
| author | kai-agent |
| metadata | {"kai":{"tags":["kai","monitoring","automation","cron","scheduled"]}} |
Continuous Monitoring
Set up automated, recurring security scans and evolution monitoring. The agent runs on a schedule, checks for new results, and reports findings to the team.
Use cases
- Scheduled code audits: Audit repos weekly or on each branch update
- Optimization progress tracking: Monitor long-running optimizations and report milestones
- Multi-repo dashboard: Regular status reports across all repos in a workspace
Setting up scheduled scans
Weekly security scan
schedule_cronjob:
name: "weekly-security-scan-[repo-name]"
schedule: "0 9 * * 1" # Every Monday at 9 AM
task: |
Run a security scan on [repo] in workspace [workspace].
Use tier [tier-id].
When complete, post a summary of findings to Slack.
Compare with last week's scan and highlight new vulnerabilities.
Daily evolution check
schedule_cronjob:
name: "evolution-monitor-[evolution-id]"
schedule: "0 */4 * * *" # Every 4 hours
task: |
Check progress of evolution [evolution-id].
If there's a significant fitness improvement since last check, notify the team.
If the evolution has completed, fetch the best program and post a summary.
Monitoring patterns
Scan comparison over time
For each scheduled scan, save results to memory:
memory: add
key: scan-results-[repo]-[date]
value: { total: N, critical: N, high: N, medium: N, low: N, new: [...], resolved: [...] }
Then compare with previous scan to generate a delta report:
- New vulnerabilities introduced
- Vulnerabilities resolved
- Severity trend (improving/degrading)
Evolution convergence tracking
Track fitness scores across iterations:
- Plot fitness over time (describe trend)
- Detect stagnation (fitness flat for 20+ iterations)
- Suggest abort if convergence is reached early
Tips
- Use descriptive cronjob names that include the repo/workspace
- Set reasonable schedules (don't audit every hour, it's wasteful)
- Always include a notification action (Slack message, log update)
- Save monitoring history in memory for trend analysis
- Use list_cronjobs and remove_cronjob to manage active monitors