Skip to main content
Artifacts are files or evidence produced during browser work. Downloads are browser-captured files from the live session.

Browser-agent result artifacts

const result = await agent.run({
  startUrl: "https://www.govinfo.gov/content/pkg/BUDGET-2025-BUD/pdf/BUDGET-2025-BUD.pdf",
  goal: "Confirm the public PDF is reachable and report whether a downloadable artifact was captured.",
});

console.log(result.artifacts);

Download from a browser

web browser downloads browser_123
web browser download browser_123 download_456 --output ./report.pdf
SDK shape:
const downloads = await browser.downloads.list();
const report = downloads.data.find((download) =>
  download.suggestedFilename?.endsWith(".pdf"),
);

if (report) {
  await browser.downloads.save(report.id, "./evidence/report.pdf", {
    overwrite: true,
    maxBytes: 25_000_000,
  });
}
Use maxBytes when your app accepts files from the web. Treat every downloaded file as untrusted input until your application validates it.

Write a generated artifact

Playwright execution can produce browser evidence that is not a site download. Use artifacts for generated files or extracted evidence that should not be squeezed into the final text answer.
await browser.playwright.execute({
  code: `
    await page.goto("https://example.com");
    const text = await page.locator("body").innerText();
    await artifacts.write("example-domain.txt", text, { mimeType: "text/plain" });
    return { url: page.url(), title: await page.title() };
  `,
});
Store artifact IDs with your job result and fetch the file only when a reviewer or downstream process needs it.

Production notes

  • Store artifact IDs and source URLs with the job result.
  • Do not squeeze large files into a final answer.
  • Treat files from the web as untrusted input.
  • Keep signed file URLs and bearer capabilities out of public logs.
Use examples such as public report download to see a full task shape.