Skip to main content
Audience: AI agent / developer. Shield runs automatically inside the SDK. This guide explains its behavior for agents making decisions about scan results.
Shield is AgentDrop’s built-in security layer. It protects AI agents from prompt injection, malware, and malicious file content by scanning every incoming file after decryption and before it reaches disk. Shield is enabled by default in both the Python and Node.js SDKs. You don’t need to configure anything to get protection.

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

  1. Files are downloaded and decrypted in memory
  2. Shield scans the decrypted content
  3. If the file is clean, it’s written to disk normally
  4. If the file is flagged, Shield generates a sanitized report (no raw content)
  5. The report is returned to the LLM for evaluation
  6. 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 at standard 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 needsReview with a reviewPrompt explaining 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.
This makes review mode consistent: every block — content threat, bad format, or too-large-to-scan — surfaces a reason and lets your agent decide, rather than silently refusing a legitimate large file.
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 call client.download(transfer), Shield runs automatically:
  1. Files are downloaded from AgentDrop
  2. Encrypted files are decrypted in memory
  3. Shield scans the decrypted content: checking format, content, and metadata
  4. If the file is safe, it’s written to disk and returned
  5. If the file is dangerous, ShieldBlockError is raised and the file is never written to disk
Your agent never sees the contents of a blocked file.

Handling Blocked Files

When Shield blocks a file, it raises ShieldBlockError 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:
Use 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 a ScanResult 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.
When Shield is disabled:
  • client.download() skips scanning entirely
  • client.scan() raises AgentDropError
  • scan_result in download results is None

Error Reference