Detect Qdrant embedding drift and verify bounded re-embedding
Compare live embeddings with stored vectors and repair an approved batch only when held-out retrieval has degraded.
Audit Anthropic Files API uploads for retention compliance, alert Slack or auto-delete stale files, and log the result for AI platform teams.
Every file uploaded to the Anthropic Files API for use as Claude prompt context sits there indefinitely unless something explicitly deletes it. A team that uploads PDFs, transcripts, or datasets for one-off analysis accumulates files nobody is tracking, some of which may hold data that should not be retained past a policy window. This blueprint lists what is actually stored right now, measures each file's real age against the retention window you set, and only deletes the stale ones once you have explicitly said this flow is allowed to.
This blueprint was created by Mohit Jeswani.
list_files (io.kestra.plugin.anthropic.ListFiles) reads up to 100 files from the
Anthropic Files API. Read-only; nothing is deleted here. allowFailure: true covers an
API or auth error without failing the flow outright.evaluate (io.kestra.plugin.core.output.OutputValues) compares each file's real
createdAt timestamp against retention_days with a jq filter, and classifies the
result as WITHIN_RETENTION, OVER_RETENTION_AUTO_DELETE, OVER_RETENTION_NEEDS_HUMAN,
or PROBE_FAILED, folding confirm_delete into the over-retention classification itself.route (io.kestra.plugin.core.flow.Switch):retention_days with io.kestra.plugin.anthropic.DeleteFile (the safe remediation,
since removing an already-expired file is the already-correct outcome), then posts a
Slack notice.summary logs the count and severity, closing the governance cycle.errors alerts Slack if the flow itself fails, for example an expired API key.confirm_delete to allow it.ListFiles and
DeleteFile used together as a compliance gate, distinct from this repo's existing
Anthropic blueprints, which call ChatCompletion and MessageBatch rather than managing
the Files API's own lifecycle.The Anthropic Files API can list and delete files on request, but it has no retention
policy, no scheduler, and no Slack integration of its own. Kestra keeps retention_days and
confirm_delete as flow inputs, turns a raw file listing into a retention decision, and
keeps a full execution history of every file this flow has seen and what happened to it.
curl or the Anthropic SDK's files.upload endpoint.The Anthropic API is a hosted service with no official standalone Docker image, so
list_files cannot be exercised against a local container; validate against a real Anthropic
account on a low-traffic API key first.
ANTHROPIC_API_KEY: the Anthropic API key used by list_files and delete_file. In
Kestra OSS, provide it as the base64-encoded environment variable
SECRET_ANTHROPIC_API_KEY.SLACK_WEBHOOK_URL: used by all three Slack alert cases and the errors block. In Kestra
OSS, provide it as the base64-encoded environment variable SECRET_SLACK_WEBHOOK_URL.| Input | Default | Purpose |
|---|---|---|
retention_days |
30 |
Age in days past which a file is classified stale |
confirm_delete |
false |
Authorizes this flow to delete stale files itself |
{{ outputs.list_files.files }}: every listed file (fileId, filename, mimeType,
size, createdAt, downloadable, scopeId), as the Files API reports them.{{ outputs.evaluate.values.stale_count }} / .stale_summary: how many files are stale
and a semicolon-joined id (filename, created at) summary of each.{{ outputs.evaluate.values.severity }}: WITHIN_RETENTION, OVER_RETENTION_AUTO_DELETE,
OVER_RETENTION_NEEDS_HUMAN, or PROBE_FAILED.ListFiles returns at most limit files (max 1000) per run with no built-in pagination
loop in this blueprint; a Files API store larger than one page needs afterId chained
across repeated runs to audit in full.createdAt is an RFC 3339 timestamp parsed with jq's fromdateiso8601, which expects
whole-second precision; verified against the actual Java Instant.toString() output in
AbstractAnthropicFiles.toMetadataInfo(), not assumed from the Javadoc, which does not
document the exact timestamp format.confirm_delete applies to every stale file found on a run, not one specific file; a
scheduled run with it set to true deletes every file past retention_days each time it
fires, so treat it as "this retention policy is fully enforced," not a one-time approval.ANTHROPIC_API_KEY and SLACK_WEBHOOK_URL secrets.retention_days value for testing.confirm_delete: false and confirm alert_over_retention
fires once the file is stale.confirm_delete: true and confirm delete_file removes it and
alert_auto_deleted fires.log_within_retention fires now that the file is gone.weekly trigger once retention_days reflects your real policy.afterId across repeated executions (persisted via a KV entry) to page through a
Files API store larger than one limit-sized call.scopeId before classifying, so a session-scoped batch of files can be retained
on a shorter policy than general-purpose uploads.