How promptfoo loads test cases from a Google Sheet
Start by confirming where promptfoo will execute, because that decides how the sheet reaches it. promptfoo runs locally: the CLI executes on a developer's machine or a CI runner, and evals talk directly with the model under test from that same place. A Google Sheet that non-engineers edit is not read by a promptfoo service. The machine or runner that runs the CLI fetches the sheet's rows, turns them into test cases, and sends each row's inputs onward to the model. Plan for that runner to have network access to both Google and the model endpoint, and confirm that the sheet's sharing settings allow access from the runner. A browser session signed in as an editor does not prove that.
Confirm the input method before you design the sheet layout. The documentation for the version you install is the authority on how a Google Sheet becomes test data: whether it accepts a sheet export link, a CSV route or another documented loader, and how it handles multiple tabs and private sheets. Do not assume a direct Google Sheets connector exists unless the docs for that version describe one. Run a small sheet through the same install the CI runner uses, and check that the row count and column names match what you expect. Record the promptfoo version and the loader method in the repository next to the config, so the next upgrade is tested against the same behavior.
Treat the sheet as a data path with its own risk. Every row you load is sent to the model under test, so the model provider's data handling applies to whatever those rows contain, including customer-like examples, internal policy text or personal data. Anyone with edit access can change expected values, and anyone with view access through a broad link can read the prompts. Decide which model provider may receive these rows, keep sheet credentials out of the repository and out of CI logs, and restrict sharing to named accounts or a dedicated service identity. Also check what the run writes to disk on the runner, since stored results may keep copies of the inputs.
Where sheet rows travel during an eval run
The diagram starts with the sheet owner, who edits rows in a Google Sheet hosted by Google. When promptfoo runs, the CLI on a laptop or CI runner fetches those rows over the network, then sends each test to the target under test at the LLM provider. Each response returns to the CLI, and results are saved to a local results store on that machine. The three boxes mark trust boundaries: the sheet sits outside your network, and the provider receives every test input. The write-back to a results tab is optional and unconfirmed for this integration, so verify it before relying on it.
Sheet rows move from Google's hosted sheet to the runner, then to the provider.
What you need before connecting a Google Sheet to promptfoo
The sheet loader depends on four things outside the test file: the promptfoo release and Node.js runtime, the Google account that owns the sheet, how the sheet is shared, and where the runner can connect. Model provider credentials sit alongside them. Settle these before you write the config, because each one changes what you ask Google Cloud or your security team to approve.
Promptfoo release and Node.js runtime
Pin one promptfoo version for both the sheet loader and the runner, starting from npm release 0.124.1, published on 8 October 2026. That release needs Node.js 22.22.0 or newer, so confirm the runner image or workstation meets it before the first sync. Record the version in your lock file or CI configuration so a later release cannot change how rows are read partway through a project.
npm packageGoogle account that owns the sheet
Decide which account owns the spreadsheet before anything else. A Google Workspace account sits under your organization's admin policies, including sharing controls and offboarding steps. A consumer account falls outside those controls, so a sheet of production prompts or sensitive examples can end up under a personal login. Confirm who can delete the file and who keeps ownership when the author changes roles or leaves.
Sharing settings for the sheet
Sharing decides who can read the test cases. Any sheet opened to anyone with the link is readable by everyone who obtains that URL, so limit access to named people or a group your team controls. Grant viewer access only to the identity the loader uses. Remove link sharing from any copy that holds sensitive examples, and review sharing after each team change, because access granted to a former contractor remains until someone removes it.
Sheet access method and Google Cloud requests
Public access and service-account access need different setup, and the method you choose determines which Google Cloud resources you request. Confirm the exact sheet access method your promptfoo version supports before you open a request for a project, a service account or API enablement. Check the release notes for the version you pinned, and ask the maintainers if the notes are unclear. Requesting resources for the wrong method costs an approval cycle and can leave unused access behind.
promptfoo releasesNetwork egress from the runner
promptfoo runs on the machine that executes the eval. That machine must reach Google to read the sheet, and it must reach each model provider endpoint to run every test. Check outbound rules, proxies and any restricted network segment before you schedule syncs. Blocked traffic often appears as a timeout rather than a clear error, so test a single row from the actual runner before you rely on the pipeline.
Model provider credentials
Each provider in the config needs its own API key or cloud identity. Store those credentials in the runner's secret store or as environment variables, and keep them out of the sheet. A key pasted into a cell is readable by everyone with sheet access and can end up in shared results. Scope each key to the project and spending limit the evals need, and rotate it on the schedule your security team sets.
Configure the sheet source in six steps
This sequence takes a shared Google Sheet from an unpinned, unchecked source to a full promptfoo run that reads the same test cases each time. Each step closes with a check you can see in the output, so a bad permission, a renamed column or a wrong tab fails early. Platform, data and configuration owners each have a clear part in the sequence.
Pin the promptfoo version
The platform engineer pins an exact promptfoo version in the project's package manifest and lockfile before anyone builds the sheet source. The npm release 0.124.1 requires Node.js 22.22.0 or newer, so confirm that version on your laptops and CI runners as well. Pinning keeps how the sheet is read consistent across machines and pipelines. Done when
npx promptfoo --versionprints the pinned version on every machine that runs the suite.Choose public or service-account access
The security or platform owner decides how promptfoo reaches the sheet. A link-shared sheet is the simplest option, but anyone holding the link can read the test data, so limit it to non-sensitive cases. For private data, create a Google service account, share the sheet with its email address as a viewer, and store the key in your secrets manager. Done when the owner has recorded which option was chosen and who holds the credentials.
Prepare the sheet with stable column names
The sheet owner places column headers in the first row, with one column per prompt variable or expected value. Headers stay fixed after launch because the test configuration refers to them by name. Keep one test case per row, and avoid merged cells, blank header cells and hidden columns that can shift what promptfoo reads. Done when the data row count, excluding the header, matches the number of cases the team expects to run.
Reference the sheet in the test configuration
The engineer adds the sheet as the test source in the promptfoo configuration file, pointing to the sheet identifier and the tab that holds the cases. Confirm the exact source syntax in the promptfoo documentation for your pinned version. Keep one configuration per suite so ownership stays clear, and supply service-account credentials through environment variables. Done when promptfoo parses the configuration without a schema error and lists the sheet as the test source.
Run a single-row dry run
Before the full suite, the engineer limits the run to one case, using a copy of the sheet that holds a single row or a row limit that your promptfoo version supports. Then runs
promptfoo eval. In the output, the prompt should show that row's values in place of the placeholders, and the assertion should grade against that row's expected value. Next, trigger a deliberate fetch failure, such as a wrong tab name, to confirm promptfoo returns a readable error that names the source. Done when the single case resolves and the failure message is clear.Run the full suite and reconcile counts
Once the dry run is clean, the engineer runs the full suite with the same pinned version and sheet. The number of test cases in the eval results should match the data rows in the sheet, excluding the header. Investigate any gap, since blank rows, a wrong range or a filter usually explain it. Save the promptfoo version, the sheet's last-edited time and the results together so later runs can be compared. Done when the case count matches the sheet and the run is saved for review.
How sheet columns map to promptfoo variables and assertions
This table shows how each Google Sheet column is treated when promptfoo loads the sheet as a test source. Read the third column first: it separates columns promptfoo consumes from columns that exist only for human reviewers. Keep every column your team edits in the sheet, and confirm reserved column names against the current loader documentation before your first run.
| Column | Maps to in promptfoo | Read by promptfoo | Reviewer note |
|---|---|---|---|
| Test ID | Stable label for each case, so a failed row can be traced in the sheet and in results | Confirm in your version | Keep IDs unique and never reuse a retired ID |
| Input variables (for example question or region) | Test variables that fill matching placeholders in the prompt | Yes | Header names must match prompt placeholders exactly, including case |
| Expected output (column with the reserved expected prefix) | Value that an assertion compares against the model output | Yes | Confirm the reserved column name in the CSV loader docs before use |
| Rubric | Criteria text for a model-graded assertion such as llm-rubric | Yes, when an assertion references it | Write rubrics as pass or fail criteria that a reviewer can check by hand |
| Assertion type | Names the check to run against the expected value | Yes, when the loader pairs it with the expected value | Confirm the exact syntax and available types for your promptfoo version |
| Tags | Labels for selecting subsets of cases in a run | Only when your run or config filters on them | Use a small fixed vocabulary so filters stay predictable |
| Owner | Reviewer accountable for the case and its expected answer | No, human review only | Use it to route failed cases to the right domain expert |
Choosing public or service-account access without leaking test data
Both access models put the same test data in front of a reader, so the choice depends on who holds the credential, how quickly access can be removed and who can see it used. Use the cards to decide which model fits each sheet, and keep the self-hosted promptfoo server off public networks in either case.
Who can read a public link
A sheet set to anyone with the link can read can be fetched by any process that holds the URL, with no sign-in and no identity attached to the request. This is the fastest setup for a quick eval, but it only suits sheets that hold synthetic prompts and expected answers. Ask your Workspace administrator whether link sharing is allowed for the sheet owner, because many organizations restrict it at the domain level.
What happens when a link is forwarded
The sharing link is effectively a password that anyone can copy. Forwarding it in chat, pasting it into a ticket or leaving it in a CI log gives every recipient the same read access, and the sheet does not record who copied it. Keep personal data, customer records and unreleased prompts out of any link-shared sheet, and replace them with synthetic or redacted rows. Check whether your pipeline prints the source URL in its logs.
How revocation works
Switching the sheet back to restricted blocks new reads through the link, and removing a service account from the sheet blocks its future reads. Copies already downloaded stay downloaded, including files in a CI cache, local eval results and exported reports. Confirm how long your pipeline keeps cached copies, and write the revocation steps into the runbook before go-live.
Audit visibility
With a service account, the account email appears in the sheet's sharing list, and its reads can be traced to one identity in Drive activity records if your Workspace edition logs them. A public link reads as anonymous, so the sheet cannot show who opened it. Confirm which events your edition logs, forward them to your security monitoring, and record which pipeline or workstation holds each service account.
Storing service-account keys
A service-account JSON key is a long-lived credential that can read every sheet shared with that account. Store it in a secrets manager such as OpenBao or your cloud provider's secrets service, and inject it into the eval job at runtime as an environment variable or mounted file. Never commit the key to the repository or the promptfoo config. Share each sheet with the account individually, rotate keys on a schedule you set and confirm your secrets manager logs each read.
Keeping the self-hosted server private
The self-hosted promptfoo app ships with no built-in authentication or SSO, and its local SQLite database is not recommended for production use. Anyone who can reach the web UI or API can view evals and the test data inside them, so place the server on a private network behind an access layer your organization already controls, such as a VPN or an identity-aware proxy. Read the self-hosting guide before choosing a deployment target, and confirm which network path your CLI users need.
Self-hosting guideWriting results back to the sheet: what to confirm first
Teams often want a pass or fail result recorded beside each row of the sheet they test from, so reviewers can see outcomes without opening promptfoo. Whether promptfoo can do that is a question for its documentation for the exact version you run, and the answer must be confirmed before anyone designs around it. Writing is a different permission from reading. A service account that loads test cases needs viewer access to the file, while any write path needs edit access, and that edit access covers every tab in the file, including the one holding the test cases. Before you approve a write path, ask the team to name the exact mechanism, the account it uses and the minimum sheet permission it needs, then check each claim against the documentation and a test copy.
Until the write path is confirmed, keep results where promptfoo already puts them: the output file or export your pipeline produces for each run. A reviewer who needs a pass or fail view can build one from those files, either by hand or with a short script run by the team that owns the results. That keeps the sheet read-only, so the test source is unaffected if the write mechanism turns out to need broader access than anyone expected. The cost is a manual step in each review cycle, and that step belongs in the plan so reviewers know results are not yet posted to the sheet automatically.
If the write path is confirmed and the team still wants results beside the cases, limit the blast radius before any grant is made. A separate results tab in the source file is the weakest option, because Google sharing applies to the whole file, so an edit grant would also reach the test cases on every other tab. A reviewed copy is stronger: a second spreadsheet, created from the approved cases, that the service account may edit. If the write scope proves wider than expected, the damage stays in the copy and the source stays read-only. Refresh the copy only after a named reviewer signs off on the source changes, and keep a record of who approved each refresh.
Why a Google Sheet test source fails and how to fix it
This table lists the failures that commonly stop promptfoo from reading a Google Sheet as a test source. Each row gives the likely cause, the check to run on the runner or in the sheet, and the fix. Work through the checks in order, starting with network and access, because a blocked request or a sign-in page hides every later problem.
| Failure | Likely cause | Check to run | Fix |
|---|---|---|---|
| Sheet not shared with the runner | The sheet is shared with a personal account, but the runner authenticates as a different identity. | Compare the sheet's sharing list with the runner's service account email. | Share the sheet with the service account email as a viewer. |
| Link resolves to a sign-in page | The URL is an edit link, or the sheet requires sign-in for anonymous requests. | Request the export URL without a browser session and check for an HTML login page. | Use a sharing setting that allows reader access, or switch to service-account access. |
| Header names change between runs | Someone renamed or reordered columns, so variable names no longer match the config. | Compare the first row of the sheet with the column names your config expects. | Add a pre-run check in CI that fails when an expected header is missing. |
| Duplicate or blank rows | Trailing blank rows or copied rows become test cases with empty variables. | Count rows with empty required cells and look for repeated IDs. | Filter blank rows in the sheet and require a unique ID column. |
| Node.js below 22.22.0 | The promptfoo release you install requires Node.js 22.22.0 or newer, and the runner image is older. | Run node --version on the runner before the eval step. | Pin Node.js 22.22.0 or newer in the CI image or setup step. |
| No egress to Google | Corporate firewalls, proxies or private runners block requests to Google endpoints. | Send a plain HTTPS request to the export URL from the runner and check the response code. | Allow outbound HTTPS to the required Google hosts, or run the job on a network that permits it. |
| Rate or size limits truncate large sheets | Large sheets or frequent pulls can hit quota limits or return incomplete data. | Compare the row count in the loaded test set with the row count in the sheet. | Split large sheets into several tabs or files, cache the pull, and confirm current limits with Google. |
Questions teams ask before loading test cases from Google Sheets
What drives the cost of loading promptfoo test cases from Google Sheets?
Most of the cost is engineering time to connect the sheet, set up access and check that every row maps correctly to prompt variables and assertions. Promptfoo is MIT licensed, so the software adds no license fee to this work. Costs rise with the number of sheets and tabs, how far column conventions differ between teams, whether access uses a service account or a shared link, and whether results are written back to the sheet. The setup work is one-time: configuration, access setup, validating the first load and documenting column conventions. The recurring costs are model API calls for each eval run and the upkeep when someone renames a column or adds a tab. Ask for a quote built on a written scope that lists each sheet, its owner, the access model and whether results write back to the sheet.
How long does an internal engineer need to wire up a Google Sheet for promptfoo?
No duration fits every team, so the answer depends on a few drivers. The first sheet takes longer than later ones because access and column conventions get settled once and then reused. Time grows with access complexity, especially if your identity policy requires a service account with a named permission grant. Time also grows with how many assertion types the sheet carries, how messy the source data is, whether results write back to the sheet, and how the load runs in CI. Ask your team to estimate from a written scope that lists the sheet count, the column list and the access model. Then check that estimate against one pilot sheet before committing to the rest.
What does the owner of a shared test sheet need to provide?
The owner decides who can read or edit the sheet and sets the rules for its content, so the engineering work depends on their answers. Before the build starts, the owner should provide:
- A named contact who approves column changes and new tabs.
- A stable header row, with each column's meaning and expected values written down.
- A decision on who may view the sheet, and whether service accounts or named users receive access.
- Sign-off on whether evaluation results may be written back into the sheet.
The owner also classifies the data. They should say whether any row holds customer data, credentials or unreleased product detail, because that decides how the sheet may be shared.
Can an internal team load Google Sheets test cases without outside help?
Yes, a team that already runs promptfoo from the command line can usually handle a single sheet with simple columns and an uncomplicated access model, using the sheet loading steps in the promptfoo documentation. Outside help tends to pay off in three areas: designing the access model against your identity policy, handling credentials in CI without exposing them, and writing the column conventions and runbook the next engineer will need. Teams should also decide whether a pilot on one sheet proves the approach before they copy it across many sheets. DeployOpen plans, implements and documents this kind of work inside your own infrastructure, and scope and deliverables are agreed in writing before work starts. If you want an outside review of your setup, ask for a written scope.
Is it ever acceptable to share a test case sheet publicly?
Only for content that would be harmless if anyone read it, such as published examples or synthetic prompts that contain no customer data, credentials, internal system prompts or unreleased product details. Anyone with a public link can read the sheet, and links get forwarded and copied. Copies that readers make stay outside your control even after you switch sharing off. For anything from production, support tickets or regulated data, restrict access to named users or a service account, and keep the sheet out of link sharing. Check your Google Workspace sharing policy before you publish, because an administrator may block public links entirely. Treat a public sheet as published material from the start, and review its rows before each change.
Does the free promptfoo Community edition cover sheet-based test cases?
The Community edition is free and includes all LLM evaluation features, all model providers and integrations, and red teaming with 10k probes per month, with community support. Loading test cases from a sheet is part of evaluation setup, so the work in this guide does not depend on a paid edition. Confirm the current behavior in the promptfoo documentation before you commit. Enterprise adds team sharing, teams-based access control and SSO, custom roles and permissions, continuous monitoring and priority support with SLAs. Enterprise pricing is custom, so ask promptfoo for a quote if you need those features. On-Premise runs the Enterprise functionality on your own infrastructure with a dedicated deployment engineer. The self-hosted server stores data in SQLite and is not recommended for production, so plan team access around that limit. Current plan details are on the promptfoo pricing page.
How DeployOpen scopes and delivers a Google Sheets test source
DeployOpen scopes Loading promptfoo test cases from Google Sheets as a fixed-scope piece of work, agreed in writing before any build starts. The written scope settles which sheets feed which suites, how access is granted, and whether results are written back, then the work is carried out inside your own environment.
How we scope
- The written scope lists the sheets, tabs and column layouts that become promptfoo test cases and assertions.
- Access is agreed up front: link-based sharing for non-sensitive data, or a service account for restricted sheets.
- Scope also records whether results are written back to the sheet and who may edit the source tabs.
How we build
- Keep the sheet ID and credentials in environment variables or a secret store, and out of committed config files.
- Test the loader against a copy of the sheet with edge cases: empty rows, merged headers, and missing expected values.
- Verify that a sample run reads every intended row and that write-back lands in the right columns.
How we hand over
- A runbook covers the sheet owners, access grants, how to rotate credentials and how to revoke a service account.
- Documentation describes the column conventions editors must follow so new rows load without changes to the config.
- Your team receives the working config, the loader code and a walkthrough of the run and its results.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers, covering changes to promptfoo and the sheet layout.
- Retainer work can be scoped to fix permission changes or column renames that break the loader after go-live.
- Confirm with your security team which sheets may hold test data before access is granted in the written scope.

