Share links: per-device AI limits and an MCP "Share links" switch
All checks were successful
Verify and publish V2 container / build-and-push (push) Successful in 28s

- Each MCP server gets a "Share links" switch (off by default). Shared Explain and Ask use
  only the servers that have it on.
- Visitor AI requests are limited per device instead of per IP, so one campus network
  doesn't share an allowance. Each browser gets a random id in a signed, HTTP-only cookie
  (20 requests per 10 minutes per link). Forged ids are replaced. A link-wide cap of 500
  requests per hour stays as a cost backstop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Elijah 2026-11-15 16:12:45 -07:00
parent 031f7bec31
commit 60cf2322f7
7 changed files with 128 additions and 45 deletions

View file

@ -93,14 +93,15 @@ Each server has:
- **When to use it**: your instructions, added to the model's prompt next to the server's tools.
- **Where it can be used**: Assistant chat, Explain this, Generating material (quizzes,
flashcards, study guides) and Quiz check, each switched separately. New servers are on for
chat and Explain only.
flashcards, study guides), Quiz check and Share links, each switched separately. New servers
are on for chat and Explain only. "Share links" lets visitors of links with AI turned on use
the server through your account; leave it off for servers with private data or paid keys.
Tools are offered as `mcp_<server>__<tool>`, at most 48 per request. A server that cannot be
reached is skipped for that request, and the assistant is told it is unavailable. During
generation the model may make up to four rounds of tool calls before it must submit its
answer; the quiz check allows four external calls. Tool output is treated as data, not
instructions. MCP tools are never offered on share links.
instructions. On share links only servers with "Share links" switched on are offered.
## AI on share links
@ -111,10 +112,16 @@ Each share link has two switches, both off by default:
share), so a link cannot be used to run arbitrary prompts.
- **Ask about this material**: a chat that answers from the shared item (or, for a shared
class or folder, the item being viewed, the list of materials and passages from its
documents). It has no tools, cannot read the rest of the library and saves nothing.
documents). It cannot read the rest of the library and saves nothing.
Both use the owner's models and keys, and are rate-limited to 20 requests per visitor per 10
minutes and 150 per link per hour. They show only when an AI model is configured.
Neither has library tools; MCP servers join only when allowed on share links. Both use the
owner's models and keys and show only when an AI model is configured.
Limits are per device, not per IP address, so students on one campus network do not share an
allowance: each browser gets a random visitor id in a signed, HTTP-only cookie
(`sd_visitor`, scoped to `/api/public`), limited to 20 requests per 10 minutes per link. A
forged cookie is replaced with a new id. Because clearing cookies gives a fresh allowance, each
link also has a cap of 500 requests per hour across all visitors.
## Original documents