跳到正文
LlamaIndex:产品、工程与评测·· 1 天前AI 评分52

LlamaParse 如何针对敏感文档强化 AI 应用安全测试

How We Harden Application Testing For the Most Sensitive Documents

AI 导读

LlamaParse 介绍如何用 Trace 的 agentic DAST 对 LlamaParse 的 AI 功能做渗透测试,覆盖全部十类 OWASP LLM 风险及标准 Web 风险,灰盒方式持续 4 天。测试发现白底白字隐藏行发票能让提取返回篡改后的总额和银行账号,团队据此划分平台与客户的安全职责边界,并建议对第三方文档限制共享索引权限、对高敏文件使用 do_not_cache=true。

正文 · 原文

LlamaParse turns PDFs, scans, and other messy files into structured data that AI applications can use. Many of those files are sensitive, including financial filings, insurance claims, and contracts. Before a company sends us any of them, security teams usually review our enterprise readiness documentation: SOC 2 reports, data policies, DPAs, and third-party pen tests.

Traditional pen tests are good at web apps and APIs. They aren’t built for the parts of LlamaParse where a model reads customer documents, and we wanted those tested just as thoroughly. This post covers how we did that and what we learned.

Where a document goes

In most web apps, untrusted input comes in through a form field. In LlamaParse, it comes in as a whole file, often written by someone outside the customer’s company, and it touches almost everything. We parse it, classify it, pull out fields, and index it for search. Then it gets read again by agents that customers deploy on LlamaParse and by AI assistants connected through our MCP server. A document could try to steer any of those steps.

OWASP, the nonprofit best known for its Top 10 list of web app risks, keeps a separate list of ten risks for LLM applications. Here’s how each one could show up in a document platform:

OWASP LLM riskHow it could show up in LlamaParse
Prompt injectionText inside a document tries to change what parsing, extraction, or chat does
Sensitive information disclosureA query returns data from another user, project, or organization
Supply chainA model, library, or dataset we depend on behaves unexpectedly
Data and model poisoningSomeone plants content in an index that later gets treated as trustworthy
Improper output handlingExtracted values flow into other systems without being checked
Excessive agencyAn agent or MCP tool can do more than its task needs
System prompt leakageA model reveals its configuration or internal instructions
Vector and embedding weaknessesSearch returns content it shouldn’t, or someone can change what an index contains
MisinformationOutput looks right, is wrong, and someone acts on it
Unbounded consumptionA user pushes usage past intended limits and slows things down for everyone else

Why AI features need a different kind of test

A classic API pen test checks, for example, whether any endpoint responds without authentication. You call every endpoint without a token. Each one either rejects the request or it doesn’t, so one pass gives you a yes-or-no answer.

Models don’t work that way. The same request can get different responses, and the input itself can change how the system behaves. Scanning the source code doesn’t help much either, since a model’s behavior isn’t in the code. To test an LLM feature, a tester has to keep adjusting after every failed attempt, then repeat whatever works to show it’s reliable. Doing that for ten risk categories across every AI feature takes more patience than a few weeks of manual testing allows.

That’s where Trace came in. Trace does agentic DAST (dynamic application security testing). Its AI agents attack a running app, decide what to try next based on each response, and prove what they find with a working exploit. An OSCP-certified engineer reviews every finding before it reaches us, and once fixes are verified, Trace issues an audit-ready report, which is the kind of evidence our customers’ security teams ask for.

We gave Trace the same starting point an attacker would have after signing up: working credentials, but no source code or cloud access.

ApproachGreybox: working credentials, no access to source code or cloud configuration
EnvironmentLlamaParse production
TenancyTest accounts in separate organizations, so the boundaries between customers were tested from both sides
PlatformWeb app, sign-in, public API
AI featuresParsing, classification, and extraction
Indexing, retrieval
Deployed agents
MCP server
CoverageAll ten OWASP LLM risks, plus the standard OWASP web app risks
Duration4 days

Some LlamaParse features only make sense once you build something with them, so Trace’s agents did that. They read our docs end to end, created a GitHub repo, wrote Python code, generated sample PDFs, uploaded them, ran them through the code, then changed the code and ran it again. They worked through these flows in parallel, which is how they covered the whole platform in four days. We also told them how the platform is supposed to behave, so they could tell real issues from expected behavior.

Trace runs its agents on frontier models through Anthropic’s Cyber Verification Program and OpenAI’s Daybreak program, which give vetted security companies models with fewer refusals for systems they’re authorized to test. The agents stayed on targets we’d agreed on, used only accounts we set up, proved issues without pulling real records, and never ran denial-of-service or brute-force attacks. Trace staff could pause any session.

What we learned

Our findings reached business logic, the boundaries between organizations, and how our models behave when a document tries to steer them. We fixed or mitigated every issue in the platform itself.

Some findings made us rethink where our job ends and the customer’s begins. Here’s one.

The test built an invoice with a few extra lines printed in white on a white page, giving a “corrected” total and a different bank account. The hidden lines didn’t tell the model to do anything. They just looked like a more official version of the same fields. Anyone opening the PDF saw the normal invoice, but extraction returned the hidden values, because it reads everything on the page.

In a real attack, that invoice would come from a third party, like a supplier sending bills into a customer’s accounts-payable process. So whose job is it to decide what a document really says: ours, or the pipeline the customer builds around it?

We think extraction should report what’s on the page. Deciding which values to trust belongs in the customer’s pipeline, where the business rules live. Here’s how we split it:

LlamaParse handlesCustomers handle
Keeping each customer’s data separateWhich documents go into their workflows and indexes
Controlling access to projects and resourcesWhich parsing tier fits their documents
Making parsing and extraction behave as documentedHow they check and act on the results

Enterprise controls

The pen test is one part of what a security team reviews. The rest is in our Enterprise Readiness docs:

AreaWhat LlamaParse provides
ComplianceSOC 2 Type II audit, HIPAA support, EU deployment, and an EU Data Processing Agreement
Model trainingWe don’t train on customer data by default, and the LLM providers our managed service uses have zero-data-retention and no-training agreements with us
EncryptionAES-256 at rest, TLS 1.2 or higher in transit
RetentionUploaded files are cached for 48 hours, then deleted. You can delete data any time through the API or UI, or skip caching with do_not_cache=true
DeploymentManaged SaaS in North America or the EU, single-tenant SaaS, your own AWS, Azure, or GCP account, or self-hosted
Sign-in and accessSSO through SAML or OIDC, plus role-based access control
DocumentationA Trust Center with our subprocessor list and security docs, and pen test summaries under NDA

If you process third-party documents

Treat documents from suppliers, applicants, or policyholders as untrusted input. Limit who can add documents to shared indexes, check extracted values before acting on anything high-stakes like a payment, and use do_not_cache=true for your most sensitive files.

What’s next

This was a point-in-time test, and every new feature changes what there is to attack. We expect security testing to move toward people working alongside AI, and eventually toward tests that run every time we ship.

If you’re evaluating LlamaParse for sensitive work, start with the Enterprise Readiness docs. You can request our pen test summary through the Trust Center, or talk to us about single-tenant and self-hosted deployments.

来源:LlamaIndex:产品、工程与评测 · llamaindex.ai