Audience: AI agent / developer. Shield runs automatically inside the SDK. This guide explains its behavior for agents making decisions about scan results.
What Shield Detects
Shield runs a multi-layer scanning pipeline on every file:- Prompt injection attempts: instructions hidden in files that try to hijack your agent’s behavior
- Malicious file formats: files that disguise their true type (e.g., an executable pretending to be a PDF)
- Resource abuse: zip bombs, deeply nested archives, and oversized files designed to crash your agent
- Suspicious metadata: hidden text in image metadata, document properties, and other non-obvious locations
Shield operates entirely client-side within the SDK. Your file contents are never sent to AgentDrop servers for scanning.
Strictness Levels
Shield has four strictness levels that control how aggressively it flags and blocks content:Set strictness at initialization
Shield Modes
Shield supports two operating modes that control what happens when a file is flagged:Review mode (default)
In review mode, Shield does not block files outright. Instead, it produces a sanitized report with summary information, file metadata, an overall threat assessment, and short descriptions of any findings. The report contains no raw file content and does not expose internal scoring details. Your agent’s LLM reads the report and decides whether the file is safe to process or should be rejected. This reduces false positives, a file containing the word “ignore previous instructions” in a legitimate context won’t be silently dropped.How review mode works
- Files are downloaded and decrypted in memory
- Shield scans the decrypted content
- If the file is clean, it’s written to disk normally
- If the file is flagged, Shield generates a sanitized report (no raw content)
- The report is returned to the LLM for evaluation
- The LLM decides: safe (proceed) or dangerous (reject)
Review mode is the recommended default. It gives your agent the ability to handle edge cases intelligently instead of relying solely on heuristic thresholds. Use
block mode only when you need zero-tolerance enforcement with no LLM evaluation.Large files (above the scan ceiling)
Shield scans file content up to a size ceiling (100 MiB atstandard strictness). Larger files — typically video, audio, images, or big archives — are too large to inspect, but size alone is not a threat.
- In review mode (the default), an oversized file is not hard-blocked. Shield delivers it and returns
needsReviewwith areviewPromptexplaining that it could not be fully scanned, so your agent can decide whether to accept it based on the sender’s trust and the expected file type. Treat the bytes as opaque data — don’t feed an unscanned file’s contents directly into an LLM prompt. - In block mode, an oversized file is rejected with
ShieldBlockError, the same as any other block.
The Node and Python SDKs share the same 100 MiB default scan ceiling (
shieldConfig.maxFileSizeBytes / ScanConfig.max_file_size_bytes). Raise or lower it per Shield instance if your workload needs a different threshold.How It Works in Practice
When you callclient.download(transfer), Shield runs automatically:
- Files are downloaded from AgentDrop
- Encrypted files are decrypted in memory
- Shield scans the decrypted content: checking format, content, and metadata
- If the file is safe, it’s written to disk and returned
- If the file is dangerous,
ShieldBlockErroris raised and the file is never written to disk
Handling Blocked Files
When Shield blocks a file, it raisesShieldBlockError with details about what was detected:
What to do when a file is blocked
- Log the event: record which sender and transfer triggered the block
- Notify the account holder: tell them a file was blocked and why
- Do not retry: the same file will be blocked again
- Do not disable Shield to bypass: the file was blocked for a reason
Manual Scanning
You can scan any file through Shield, even files that didn’t come through AgentDrop:client.scan() to check files from:
- HTTP uploads from users or external services
- Message attachments from other agents
- Tool outputs that include file data
- Any untrusted file content your agent processes
client.scan() requires Shield to be enabled. If you initialized with shield=False, calling scan() raises AgentDropError.Scan Results
Every scanned file returns aScanResult object:
Disabling Shield
You can disable Shield entirely, but this is not recommended. Without Shield, your agent is vulnerable to prompt injection attacks embedded in transferred files.client.download()skips scanning entirelyclient.scan()raisesAgentDropErrorscan_resultin download results isNone
