Repository navigation
[AI-3870] Pin delegation's pinned-digest check; own SDK note for AI-3871 - #2480
Conversation
A delegation judges an http tool read-only only at the digest its grant pins: rows in ChildAgentsSuite kill the bindingSendsOut -> SendsOutTool mutant. The AI-3871 SDK note moves out of the AI-3676 note into its own file. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
kanat
left a comment
There was a problem hiding this comment.
VERDICT: GO
Reviewed 399e1fc merged onto bc0700e (already up to date). TestChildAgentsSuite passes on the head on a private test DB (go vet -tags integration ./internal/api/ clean). Checks on the head: labeler and GitGuardian pass; go and integration are skipped (draft), so CI runs at gh pr ready.
Mutations of internal/connectors/sensitive/sensitive.go, each run against the whole TestChildAgentsSuite, each killed only by the new test: bindingSendsOut -> SendsOutTool (R1), digest != grant.SchemaDigest -> ==, -> grant.SchemaDigest == "" (pinned-another case), -> grant.SchemaDigest != "" && digest != ... (pinned-nothing case), -> (digest == "") != (grant.SchemaDigest == ""), -> digest == "" && ..., -> err != nil || (grant.SchemaDigest == "" && digest != ""). 7 checked, 0 survived. The err != nil branch is unreachable (the digest is JSON of strings and maps) and is not a rule.
Notes: the AI-3871 paragraph in 2026-11-25-ai-3871.md is byte-identical to the one #2464 appended (line 3 of the old AI-3676 note); the AI-3676 note differs from #2344's only in the Connector sentence. sdk/SKILL.md says a later PR that settles part of a note edits that note's file, and notes/README.md asks one file per change: the move follows both. The new note's name is <date>-<ticket>.md. On the author's question: keep the sentence as it is. "Unchanged by this change, so it shows neither base_url nor the tools" stays true after AI-3871 (the sources entry never carries a URL, a path or a tool), and the pointer to the new file stops a reader of the AI-3676 note from missing the field.
One Nit (ticket, not this PR): see the inline comment.
| run := s.run(CreateRunRequest{ConfigId: parent.Id, Input: "review this"}) | ||
|
|
||
| if c.refused { | ||
| s.refusedAll(run) |
There was a problem hiding this comment.
[Nit] R1.1 refusedAll has fixed messages, so a failing refused case does not say which of the 4 refused cases (grant x layout) broke: under the SendsOutTool mutant the output is four identical the graph breaks the rule whichever child is called lines, while the run case names name+", "+layout. Wrapping the loop body in s.Run(name+", "+layout, ...) would name it. Ticket, not a blocker; map loops are the norm in this package (ConfigsSuite.TestAnHTTPToolReadsOnlyAtTheDigestItsGrantPins does the same).
…runs as its own subtest (#2480 R1.1) A failure now names its case, the refused ones too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Feature branch for [AI-3669](https://linear.app/stream/issue/AI-3669): the router gets an `http` tool source. A file `connectors/http/<name>.yaml` names a public https base URL and read-only tools. Once synced, an agent calls those tools with a user's credential. ## What it does ``` connectors/http/<name>.yaml │ CLI sync v POST /v1/agents/connectors (http block) │ v manifest, sources/http │ agent session offers the tool v session tool call -> base_url + path, with the connection's credential ``` Safety rules. Each is checked when the connector is saved, at each call, or both: | Rule | Effect | Checked | |---|---|---| | Public https only | `base_url` goes through the egress check; private and plain-http hosts are refused | save (`CheckBaseURL`), and every call, as the connection's client is the egress client | | `read_only` GET and HEAD | other methods are refused on `read_only` tools | save. A tool whose definition changed since its grant is not offered (the grant pins a digest of method, path and `read_only`) | | Override args refused | the model cannot change the method, host or headers | save refuses a parameter or header named like a method override; a call refuses an argument the tool does not declare, before anything is sent | | Path segments escaped | `..%2Fadmin` stays one segment | every call | | Size caps | 4 MiB read from the provider, 32 KiB to the model (with a marker) | every call | | Egress limits | the same egress client and the same 4 MiB read cap as the MCP source, and #2430's import limits | every call; import | ## Pieces All merged into this branch, each reviewed on its own PR. Three commits on the branch itself follow the last main sync: the feature's caps become core's after #2430, a subtest split of #2480's test, and a test that an http custom connector meets an MCP one's limits. | Piece | Ticket | PR | Merge commit | |---|---|---|---| | Manifest model for http tools | AI-3673 | [#2303](#2303) | 7d1d6b7 | | `sources/http` tool source | AI-3674 | [#2316](#2316) | 2a29dac | | Call-time safety | AI-3675 | [#2324](#2324) | 5a798ad | | API accepts http connectors (keystone) | AI-3676 | [#2344](#2344) | aed810a | | A connector's answer names its source kind | AI-3871 | [#2464](#2464) | c72f50f | | Pin delegation's digest check; own SDK note | AI-3870 | [#2480](#2480) | 73e80f2 | | Fake provider's CodeQL alert; SDK skill names http connectors | AI-3870 | [#2483](#2483) | 469960b | Main was merged into the branch 9 times; the last is main `f58ff6eb3`. An earlier one, main `c4119ba23`, carries [#2430](#2430 import limits. Imported http connectors are held to the same limits. The merge of main `8232d25af` brings in two changes that touch http connectors: - [#2485](#2485) refuses imported agent configs that break the sensitive-connector rule. An http connector's tools are weighed by their own rule: a tool that is not read-only, or a read-only tool granted without its digest, is refused. A test covers this (`TestAnImportedHTTPConnectorAnAgentBindsBesideASensitiveOneIsWeighedByItsTools`). - [#2434](#2434) adds `check_changes` to a custom connector create. An http connector takes the same path as an MCP one, and a test covers the http case (`TestACheckedSyncOfAnHTTPConnectorIsRefusedOnlyOverAnEditNoSyncWrote`). ## Acceptance AC-1..AC-9 are frozen in the epic. The staging window was opened twice on the branch build, then staging was restored. | AC | Result | Checked | |---|---|---| | AC-1 | pass | staging windows 1 and 2 (router part). The CLI line (first sync prints the connector id) is in [GetStream/cli#128](GetStream/cli#128) | | AC-2 | pass | staging window 1 and 2 | | AC-3 | pass | staging window 1 and 2: one tool call, the agent answered from it | | AC-4 | pass | staging window 1 and 2 | | AC-5 | pass | staging window 1 and 2 | | AC-6 | pass | local router: override args refused, the fake provider saw 0 requests | | AC-7 | pass | staging, by API and by CLI | | AC-8 | pass | staging window 1 and 2: a JSON body comes back as `application/json` | | AC-9 | pass | local router: 100 KiB cut to 32768 B with a marker, 5 MiB cut at the 4 MiB read cap | Rulings by Kanat (2026-11-25): - AC-4: the "no token" clause is read as a wrong token. A wrong token gives a tool error 401. A connection with no token at all stays `not_connected` and its tool is not offered, as before. - AC-5: the CLI refuses a `read_only` POST or DELETE locally, before any request. The router refuses the same with a 400 on a direct POST. ## Gates for the merge into main | Gate | What | |---|---| | a | Done: [#2481](#2481) merged into main (`96d535d9d`), which fixed main's integration build at `scheduled_unpaid_test.go:814`. This branch builds and vets with the integration tag merged onto main `aa4c2d4d9` | | b | Full CI green once this PR leaves draft (a draft runs none of the go or integration jobs) | | c | [GetStream/cli#128](GetStream/cli#128) merges after this is deployed, then the docs leaf AI-3678 | | d | SDK releases that carry `Connector.sources` go out only after the router deploy: the generated Python and Rust clients cannot parse a connector from an older router | | e | No migration, no flag. A rollback to the previous build fails closed: an http binding is unavailable, and every http tool counts as sending out | ## Breaking change From `CHANGELOG.md` on the branch, under Unreleased, Breaking Changes: **`CustomConnectorRequest`'s endpoint is optional in the Go, Rust, PHP and Python SDKs** - Go: `CustomConnectorRequest.Endpoint` is now `*string`. Set it with a pointer (for example `Endpoint: &url`); a caller that set a plain string no longer compiles. - Rust: `CustomConnectorRequest.endpoint` is now `Option<String>`. Set it with `Some(url)`; a struct literal with a plain `String`, or a read of one, no longer compiles. - PHP: the `CustomConnectorRequest` constructor takes `$endpoint` after `$schemes`, not first. A positional call no longer matches; named arguments work as before. - Python (`plugins/stream`): the generated `CustomConnectorRequest` takes `endpoint` after `schemes`, not first. A positional call no longer matches; keyword arguments work as before. ## Rollout ``` merge this PR -> deploy to staging -> recheck AC-3 and AC-8 live -> merge cli#128 -> docs (AI-3678) -> SDK releases with Connector.sources ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Targets
feature/ai-3669-http-connectors, not main. Two small leftovers of AI-3669; tests and docs only, no router code changes.1. Delegation judges an http tool by its pinned digest
bindingSendsOut(sensitive.go) callsGrantSendsOut, which judges an http tool at the digest its grant pins. Replacing that call withmanifest.SendsOutTool(tool.Name)passed every ChildAgentsSuite test. The new test wires, past the API, a parent and a child with nessy (sensitive) and an http connector whose latest revision hasget, a read-only GET:Mutants (one script,
mutate.sh):bindingSendsOut->SendsOutTool,digest != grant.SchemaDigest->digest == ""and-> digest == grant.SchemaDigesteach fail the test; the head passes.2. SDK notes
#2464 appended the AI-3871 part to the AI-3676 note;
notes/README.mdasks one file per change, and the AI-3676 note said theConnectoris unchanged. The AI-3871 paragraph is now2026-11-25-ai-3871.mdunchanged; the AI-3676 note is back as #2344 wrote it, except that itsConnectorsentence says "unchanged by this change" and points to the new note.🤖 Generated with Claude Code