Skip to content

feat: Add a docs eval for secure apis - #544

Open
jeremenichelli wants to merge 1 commit into
mainfrom
jeremiasmenichelli/docs-1645-secure-your-api-eval
Open

jeremenichelli wants to merge 1 commit into
mainfrom
jeremiasmenichelli/docs-1645-secure-your-api-eval

Conversation

@jeremenichelli

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Feature: a new docs eval, build-docs-020-securing-your-api.

What is the current behavior?

There is no eval for the Securing your API guide, so nothing checks what an
agent leaves reachable through the Data API after following it.

What is the new behavior?

The eval has an agent build a support console's replies and notes tables and
its nightly job. It then checks that:

  • replies are readable only by the ticket's customer
  • internal notes are readable by nobody, including the ticket's customer
  • no client can write notes
  • no client can run close_stale_tickets
  • the server key can still reach its own tables and function

Additional context

  • The replies check waits out PGRST303 JWT issued at future after sign-up.
    It reports could-not-measure if the error never clears.
  • The server-key check no longer reads replies back as service_role, since
    the console never does. It confirms the reply row as the superuser, and the
    check is now named the server key can write replies, and write and read notes.
  • The probes have not been run against a local stack yet.

@jeremenichelli
jeremenichelli requested a review from a team as a code owner November 23, 2026 14:49
@vercel

vercel Bot commented Nov 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
evals Ignored Ignored Nov 23, 2026 2:49pm UTC

Request Review

@czenko czenko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is thorough. The seed contract and the positive controls are clear.

Issue: The README says this has not run end to end, because it was written and typechecked without a Docker daemon. Could the correct solution, the empty workspace and the page's revoke block be scored on a real stack before this merges? That is also what settles the pg_default_acl question it raises.

Issue: The prompt's "30 days" and "returns how many it closed" are only partly measured. I think where updated_at < now() - interval '1 day' returning the count would pass the server key can run close_stale_tickets, because the 60 day ticket closes and the ticket touched today stays open. Could the scorer seed a ticket idle for 10 days that has to stay open, and compare the count to the tickets closed? Or the README could name both as out of scope.

Nit: neither a customer nor a signed-out visitor can run close_stale_tickets treats any error as a refusal. I think a function with the default invoker security and execute left open reads as refused, because the call fails with 42501 on the tickets update grant. The whitelist still reds it through anon, but a revoke from anon alone leaves this check green. The README could say that the whitelist is what catches that case. :)

Read the README, prompt, scorer and seed. Unverified: I ran none of the fixtures.

@czenko czenko left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. The notes in my earlier review are suggestions.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants