Repository navigation
[AI-3676] HTTP connectors: the API accepts http connectors - #2344
Conversation
POST /v1/agents/connectors takes an optional http {base_url, tools[]}
beside endpoint, exactly one of the two. base_url must pass
egress.ValidatePublicHTTPSURL, checked before the manifest's rules so
every refusal answers one fixed message; the manifest is built through
core.CustomManifest, whose read_only rule names the tool. connectorOf
still shows neither base_url nor tools.
POST /v1/data/import loses AI-3674's http refusal and checks the
base_url the same way (importableDefinition).
openapi.yaml and the Go, JS, Python, .NET, Ruby, Rust and PHP clients
are regenerated; SDK note in .claude/skills/sdk/notes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kanat
left a comment
There was a problem hiding this comment.
VERDICT: NO-GO
Security review, round 1 (head fba0377 on the feature branch).
The trust boundaries hold. Create and import are server-side only: a device token gets a 403 and no credential gets a 401. Every write is scoped to the caller's customer. A built-in id cannot be written. The base_url egress check runs on create, on each new revision, on import and on a replayed change, and every refusal gets the same sentence. The dial-time check still covers call time. No new error text reaches a caller, and no client-side SDK changes.
One size limit is missing, which blocks the merge:
- [Should fix] S1.1: the size of an http connector's tool list is limited only by the API's 1 MiB body. Nothing caps a parameter's description, and base_url has a cap only in the request schema. An import (lines of up to 64 MiB) can therefore store a much larger http connector than the API would accept, and every session that binds it sends that tool list to the model on each turn. Fix: cap each parameter's description at
maxHTTPToolDescriptionincheckHTTPSource, and the http source's endpoint atmaxHTTPPathinManifest.Validate, so create and import share the limits. The test rows go to the fixer. - [Nit] S1.2: a base_url with a
{name}in its path, and an importedhttp://base_url, get core's wording instead of the one base_url sentence. This depends only on the URL's syntax, not on a DNS lookup, so it tells a caller nothing about the resolver. - [Question] S1.3 (unverified): on a replayed change, the import's base_url check resolves DNS inside the open transaction (
applyChanges), and only the request context bounds it. Should it have its own short timeout, or move out of the transaction?
| // CustomHTTPParameter is one value the model gives an http tool (core.HTTPParameter). | ||
| type CustomHTTPParameter struct { | ||
| Type string `json:"type" enum:"string,number,integer,boolean"` | ||
| Description string `json:"description,omitempty"` |
There was a problem hiding this comment.
[Should fix] S1.1 Nothing caps a parameter's description, here or in core (checkHTTPSource caps only the tool's description, at 1000 bytes). The base_url cap is only the schema's maxLength. An import bypasses both, so it can store an http connector larger than create would accept, and its tool list goes to the model on every turn. Fix: in core, cap each parameter's description at maxHTTPToolDescription and the http endpoint at maxHTTPPath, so create and import enforce the same limits.
There was a problem hiding this comment.
Fixed in 5a1c77a: checkHTTPSource caps each parameter description at maxHTTPToolDescription, and Manifest.Validate caps the http endpoint at maxHTTPPath. Test: HTTPSourceSuite/TestAnHTTPSourceBreakingARuleIsRefused (rows "a parameter description over 1000" and "a base_url over 2048"). Each cap removed alone fails it.
| // that error tells a name that does not resolve from one that resolves to a private address. | ||
| if core.HTTPSource(custom.Sources) != nil { | ||
| return nil, fmt.Errorf("store: imported connector definition %q: %w: an http connector cannot be imported yet", id, ErrNotACustomConnector) | ||
| if err := egress.ValidatePublicHTTPSURL(ctx, custom.Endpoints[core.SourceKindHTTP]); err != nil { |
There was a problem hiding this comment.
[Should fix] S1.1 (import side) AsCustom is the only rule set here, and core has no length caps on base_url or on parameter descriptions. An import therefore keeps what the API's body limit would refuse. It is fixed by the core caps in the other comment. Add an ImportableDefinitionSuite row for each cap.
[Question] S1.3 On a replayed change this lookup runs inside applyChanges' transaction, and only the request context bounds it. Should it get a short timeout of its own, or run before the transaction opens?
There was a problem hiding this comment.
S1.1 fixed in 5a1c77a: ImportableDefinitionSuite/TestAnOversizedHTTPConnectorIsRefused (a 2 MiB parameter description, a 4 KiB base_url). Without the parameter cap it fails.
S1.3 fixed in 7de22c6: the check now runs before the transaction opens. importableRow checks a definition before importRow, and applyChanges runs it for the whole change set before RunInTx. Test: store DataMoveSuite/TestAChangesDefinitionsAreCheckedBeforeItsTransactionOpens. Its first change names no table, so it fails only inside the transaction. The test expects the definition after it to be refused first. Moving the check back into importRow fails the test.
| // Tools). The base URL has the endpoint's limit. The other rules are core.Manifest.Validate's | ||
| // (checkHTTPSource in internal/connectors/core/http_tools.go), which answer naming the tool. | ||
| type CustomHTTPAPI struct { | ||
| BaseURL string `json:"base_url" maxLength:"2048" doc:"The API the tools call, each at its path under it: a public https URL without userinfo, query or fragment. An address on a private network, loopback or link-local is refused. Never shown once stored."` |
There was a problem hiding this comment.
[Nit] S1.2 AC-7 asks for one answer for every refused base_url. A URL that passes egress but fails core's template rule (a {name} in the path) gets core's wording. So does an imported http:// base_url, since import runs AsCustom before egress. Both depend on syntax only, never on DNS. Either accept it, or run core's endpoint rule under the same sentence.
There was a problem hiding this comment.
Fixed in 6249bd7: core.CheckBaseURL holds a base URL to core's endpoint rules (the 2048 cap, https://, no {name}) and to egress, and gives one sentence for every refusal. Create and import both run it before CustomManifest and AsCustom. Tests: ConnectorsSuite/TestAnHTTPConnectorWhoseAPIIsNotPublicHTTPSIsRefused (HTTPS://8.8.8.8, https://8.8.8.8/{x}) and ImportableDefinitionSuite/TestAnHTTPConnectorWhoseAPIIsNotPublicIsRefused (http://, HTTPS://, {x}, over 2048). Each of the four conditions removed alone fails the import test. Going back to the egress-only check in the API fails the API test.
kanat
left a comment
There was a problem hiding this comment.
VERDICT: NO-GO
Round-1 review of fba0377, merged onto feature/ai-3669-http-connectors at 5a798ad. Three Should fix items block the merge: R1.1, R1.2 and R1.3 (inline).
Checked and sound:
- Touched suites pass: api ConnectorsSuite, ConfigsSuite and DataMoveSuite; store DataMoveSuite and ImportableDefinitionSuite; unit tests for api, connectors and store.
generated.shreports no drift. The Go, .NET, Rust, Ruby, PHP and Python generator checks also find none.- The MCP control test passes against the base's
connectors.goand against the head. createConnectorhas nox-client-accessible.- AC-1, AC-2, AC-5 and AC-7 hold through the API. The AC-7 message contains the epic's phrase word for word, after the field name. The
base_urlcheck runs before core's rules, and the egress error never reaches the caller. - A stored http connector fails closed on the previous release: no such tool source.
- A trial merge with #2302 conflicts only in
add-connector/SKILL.mdand three generated files. The Go code merges cleanly, and ConnectorsSuite passes on the merge. - CI does not run on this draft. It runs at
gh pr ready.
Nits for tickets:
- [Nit] R1.4
connectors.go:190-207: the doc text states caps (1-128 tools, the name pattern, 1000 bytes, 64 parameters) that the schema has no tags for. Core enforces them. - [Nit] R1.5
datamove.go:1681: an importedhttp://base_url gets core's message from AsCustom, not the fixed base_url message that the description promises for import.
Author questions: Q1 (Go Endpoint becomes *string) was decided, and R1.1 and R1.2 widen it. Q2 (an imported MCP endpoint has no public check) goes to a ticket.
|
|
||
| // CustomHTTPParameter is one value the model gives an http tool (core.HTTPParameter). | ||
| type CustomHTTPParameter struct { | ||
| Type string `json:"type" enum:"string,number,integer,boolean"` |
There was a problem hiding this comment.
[Should fix] R1.1 This enum shares string, number and boolean with InvocationArgumentType. oapi-codegen prefixes every constant of two enums that share a value (see sdks/go/acceleration/enums_test.go). So the released Go SDK constants acceleration.Array, Boolean, Null, Number, Object and String (sdks/go v0.5.1) are renamed to InvocationArgumentType* in generated.go. Neither CHANGELOG nor the SDK note mentions this. CustomHTTPToolMethod (line 204) also exports bare GET, HEAD, POST, PUT, PATCH and DELETE, and the next enum with those values renames them the same way.
Fix: set x-enum-varnames on both properties in their TransformSchema, as connections.go:129 and schemas.go:461 do. Then regenerate, and pin InvocationArgumentType's names in enums_test.go, as TestAgentLogSourceKeepsItsConstantNames does. I checked this in a scratch copy: with CustomHTTPParameterType* and CustomHTTPToolMethod* names, the regenerated client keeps every base constant.
There was a problem hiding this comment.
Fixed in 0a50128: both properties set x-enum-varnames (CustomHTTPToolMethod*, CustomHTTPParameterType*). I regenerated openapi.yaml, Go and Python. .NET, Rust, Ruby, PHP, JS and Swift generate no change. generated.go keeps Array, Boolean, Null, Number, Object and String as on the base. Tests: TestInvocationArgumentTypeKeepsItsConstantNames and TestCustomHTTPToolMethodNamesItsConstants in sdks/go/acceleration/enums_test.go. If either extension is dropped and the client regenerated, the test no longer compiles.
|
|
||
| ### The Go SDK's `CustomConnectorRequest.Endpoint` is a pointer | ||
|
|
||
| `POST /v1/agents/connectors` now takes either an MCP `endpoint` or an `http` block with a `base_url` and its tools, so `endpoint` is optional and the generated Go type `CustomConnectorRequest.Endpoint` is now `*string`. Set it with a pointer (for example `Endpoint: &url`); a caller that set a plain string no longer compiles. The other SDKs are unchanged for existing callers (AI-3676). |
There was a problem hiding this comment.
[Should fix] R1.2 "The other SDKs are unchanged for existing callers" is not true:
- Rust:
CustomConnectorRequest.endpointis nowOption<String>(sdks/rust/src/types.rs:5291), so a struct literal or a read of aStringno longer compiles. - PHP: the constructor moves
$endpointfrom the first positional argument to after$schemes. - Python: the attrs class does the same.
Fix: name Rust, and positional PHP and Python callers, in this entry and in .claude/skills/sdk/notes/2026-11-24-ai-3676.md. If R1.1 is not fixed, add the renamed InvocationArgumentType constants as well.
There was a problem hiding this comment.
Fixed in 72ad6ec: the Breaking Changes entry now lists Go (*string), Rust (Option<String>, set with Some(url)), and positional PHP and Python callers (endpoint now comes after schemes). The SDK note 2026-11-24-ai-3676.md says the same. This is a docs change, so it has no test.
| parameters[name] = core.HTTPParameter{Type: parameter.Type, Description: parameter.Description, Required: parameter.Required} | ||
| } | ||
| tools = append(tools, core.HTTPTool{Name: tool.Name, Description: tool.Description, Method: tool.Method, | ||
| Path: tool.Path, Parameters: parameters, ReadOnly: tool.ReadOnly}) |
There was a problem hiding this comment.
[Should fix] R1.3 The mutant ReadOnly: tool.ReadOnly || tool.Method == "GET" survives all touched suites, because no test has a GET tool without read_only. Such a mutant would mark a GET tool as read-only when the file never said so.
Test row (I checked it: it passes on the head and fails under the mutant): in ConnectorsSuite/TestAConnectionToAnHTTPConnectorListsItsReadOnlyTool, add the tool {"name": "list_notes", "description": "Lists the notes.", "method": "GET", "path": "/v1/notes"} and expect {"get_forecast": true, "add_note": false, "list_notes": false}.
There was a problem hiding this comment.
Fixed in 639bbdb: ConnectorsSuite/TestAConnectionToAnHTTPConnectorListsItsReadOnlyTool has list_notes (GET, no read_only) and expects it to be false. The mutant ReadOnly: tool.ReadOnly || tool.Method == "GET" fails it.
… (S1.1) An import has no request schema, so it could store an http connector the API would refuse. Manifest.Validate now caps each parameter's description at 1000 bytes and the http source's endpoint at 2048, the caps the API's schema has, so create and import share them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (S1.2)
core.CheckBaseURL holds a base URL to the endpoint rules Manifest.Validate has for an http
custom connector (its cap, https://, no {name}) and to egress, with one sentence for every
refusal. Create and import both run it before CustomManifest and AsCustom, so an imported
http:// base URL and a {name} in one no longer get core's own words.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ction (S1.3) Checking an imported http definition resolves its base URL's host. applyChanges ran that lookup inside its transaction, bounded only by the request. importableRow now checks each definition before the transaction opens, and ImportRow runs it before importRow, so no lookup happens while a transaction is open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…R1.1) CustomHTTPParameterType shares string, number and boolean with InvocationArgumentType, so oapi-codegen prefixed both enums' constants and renamed the released Go SDK's Array, Boolean, Null, Number, Object and String. Both new enums now name their constants with x-enum-varnames, as ConnectionOwnerType does, and enums_test.go pins the old names and the new method ones. Go and Python clients regenerated; the other generators emit no change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…int breaks (R1.2) Rust's CustomConnectorRequest.endpoint is now Option<String>, and PHP's constructor and Python's attrs class take endpoint after schemes, so a positional call no longer matches. The Breaking Changes entry and the SDK note said the other SDKs were unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1.3) TestAConnectionToAnHTTPConnectorListsItsReadOnlyTool now has a GET tool that does not say read_only, so marking every GET tool read-only fails it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ttern (R1.4) The doc text stated 1 to 128 tools, the 63-character name pattern, 1000 for a description, 2048 for a path and 64 parameters, which only core enforced. The schema now has them as minItems, maxItems, pattern, maxLength and maxProperties, so what validates the request also documents it. An empty tool list is now a validation failure before core's rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kanat
left a comment
There was a problem hiding this comment.
VERDICT: NO-GO
Delta round 1, head 977f372, merged onto base 5a798ad (the head already contains it). Unit, vet (both tags) and the touched integration suites pass on a fresh test database; the draft has no go/integration CI.
Prior findings, each fix mutation-checked:
- S1.1 fixed: the parameter description cap and the base URL cap in core are pinned (caps off: tests fail).
- S1.2 / R1.5 fixed: one
core.CheckBaseURL, one fixed answer, used by create and import; each clause mutated and killed except the cap boundary (R2.1). - S1.3 fixed:
importRowreaches no egress lookup; the check runs inImportRow(no transaction) and beforeRunInTxinapplyChanges. Moving the check into the loop failsTestAChangesDefinitionsAreCheckedBeforeItsTransactionOpens. - R1.1 fixed: no exported const, func or type of
sdks/go/accelerationat v0.5.1 is removed or renamed on this head (Array, Boolean, Null, Number, Object, String keepInvocationArgumentType; newCustomHTTPParameterType*andCustomHTTPToolMethod*only). Dropping the varnames and regenerating breaksenums_test.go. Every other client's regeneration is clean (Go, JS, Python, Swift check, .NET, Rust, Ruby, PHP). - R1.2 fixed: Go, Rust, PHP and Python named; Rust
Option<String>and the PHP/Python argument order checked against the base. - R1.3 fixed: the
|| Method == "GET"mutant fails the read-only listing test. - R1.4 fixed: each of the seven schema tags, mutated one step, fails
TestAnHTTPToolTheSchemaRefusesIsAValidationFailure.
New finding:
- R2.1 [Should fix]: three mutants of delta code survive. (a)
datamove.go:1968, droppingchanges[i].Payload = payload: a change set's definition is stored without the normalization an import gets. (b)manifest.go:836and (c)custom.go:44with the cap at 2049 instead of 2048: no row sits on the boundary. Ready rows, each checked to pass on this head and fail under its mutant: below.core/http_tools_test.go, inTestAnHTTPSourceBreakingARuleIsRefused:"a base_url of 2049":Endpoints[SourceKindHTTP] = "https://api.example.com/" + strings.Repeat("a", 2025), expectingendpoints.http: is over 2048 bytes.store/datamove_unit_test.go, inTestAnHTTPConnectorWhoseAPIIsNotPublicIsRefused's list of bases:"https://8.8.8.8/" + strings.Repeat("a", 2033)(2049 bytes).store/datamove_test.go, newDataMoveSuitetest (see the inline comment)..
No new problem in the trust boundary: base_url is checked (https prefix, no braces, cap, public address) before AsCustom on both paths, with one message.
| if err != nil { | ||
| return err | ||
| } | ||
| changes[i].Payload = payload |
There was a problem hiding this comment.
Mutant: _ = payload here survives every test. Row (passes on this head, fails under the mutant), in DataMoveSuite:
func (s *DataMoveSuite) TestAChangesDefinitionArrivesWithoutAFieldThisReleaseDoesNotRead() {
id := "custom_" + newID()
manifest := strings.Replace(customManifestWith(`"later": {"env": "GOOGLE"}`), "custom_acme", id, 1)
err := s.destination.ApplyChanges(s.ctx, "moved", []DataChange{{Table: "connector_definitions", Op: ChangeInsert,
Payload: json.RawMessage(`{"id": "` + id + `", "revision": 1, "name": "Acme", "category": "", "description": "", "created_at": "2026-11-01T00:00:00Z", "manifest": ` + manifest + `}`)}})
s.Require().NoError(err)
var stored string
s.Require().NoError(s.destination.GlobalDB().QueryRowContext(s.ctx,
"SELECT manifest FROM connector_definitions WHERE customer_id = 'moved' AND id = ?", id).Scan(&stored))
var manifestStored map[string]any
s.Require().NoError(json.Unmarshal([]byte(stored), &manifestStored))
s.NotContains(manifestStored, "later")
}There was a problem hiding this comment.
Fixed in be026ba: DataMoveSuite.TestAChangesDefinitionArrivesWithoutAFieldThisReleaseDoesNotRead (store/datamove_test.go). Mutant changes[i].Payload = payload dropped: the test fails ("should not contain "later""); passes on the head. The two cap rows (a base_url of 2049 in manifest_test, a 2049-byte base in TestAnHTTPConnectorWhoseAPIIsNotPublicIsRefused) also fail under maxHTTPPath+1 at core/manifest.go:836 and core/custom.go:44.
…s at the boundary (R2.1) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
kanat
left a comment
There was a problem hiding this comment.
VERDICT: GO
Delta round 2 on PR #2344 (AI-3676). Head be026ba, previous reviewed head 977f372. Merged onto base 5a798ad: no merge needed, the base is an ancestor of the head.
The delta is one commit (be026ba) and touches only three test files (+27/-1): core/http_tools_test.go, store/datamove_test.go, store/datamove_unit_test.go. No production line changed.
Prior findings
- R2.1(a) fixed: store/datamove.go:1968 with
changes[i].Payload = payloadreplaced by_, _ = i, payload: DataMoveSuite/TestAChangesDefinitionArrivesWithoutAFieldThisReleaseDoesNotRead fails (the stored manifest keeps "later"). Passes on head. - R2.1(b) fixed: core/manifest.go:836 cap
maxHTTPPath+1: HTTPSourceSuite/TestAnHTTPSourceBreakingARuleIsRefused, row "a base_url of 2049", fails (no error returned). Passes on head. - R2.1(c) fixed: core/custom.go:44 cap
maxHTTPPath+1: ImportableDefinitionSuite/TestAnHTTPConnectorWhoseAPIIsNotPublicIsRefused fails on the 2049-byte base (the cap message is replaced by the base_url message). Passes on head. - Earlier findings S1.1, S1.2/R1.5, S1.3, R1.1 to R1.4: untouched by this delta, status as in delta-1.
New findings
- [Should fix] (unchanged code) core/manifest.go:836 and core/custom.go:44 — the lower side of the cap is not pinned.
>= maxHTTPPathsurvives TestHTTPSourceSuite and TestImportableDefinitionSuite. A base_url of exactly 2048 bytes is accepted on head, and the mutant refuses it (probes below). Fix: two rows, each checked by a probe in this review.- core, HTTPSourceSuite success case:
m := httpManifest(forecast()), endpoint"https://api.example.com/" + strings.Repeat("a", 2024)(2048 bytes),s.NoError(m.Validate()). Head passes; the>=mutant fails. - store, ImportableDefinitionSuite:
importedHTTPwith base"https://8.8.8.8/" + strings.Repeat("a", 2032)(2048 bytes), importableDefinition returns no error. Head passes; the>=mutant at custom.go:44 fails with the base_url message. - Policy: ticket (default for unchanged code). It does not block this verdict.
- core, HTTPSourceSuite success case:
Mutations
5 checked, 2 survived. The 3 R2.1 mutants are killed (above). The 2 survivors are the >= lower-side mutants at manifest.go:836 and custom.go:44; each is killed by the probe row above and by neither existing test.
Runs (head be026ba)
go test ./internal/connectors/... ./internal/store/: all packages ok.go test -count=1 -tags integration -run TestDataMoveSuite ./internal/store/: ok (fresh test database).go vet ./internal/connectors/... ./internal/store/andgo vet -tags integration ./internal/store/: ok.- Each mutant was reverted with
git checkoutafter its run; the probe files were deleted.
CI
gh pr checks 2344: the PR is a draft, so go, unit, integration and sdks are skipping. labeler and GitGuardian pass. A draft runs no CI, which is not a failure.
Unverified
- Findings S1.1, S1.2/R1.5, S1.3, R1.1 to R1.4 were not re-run this round; the diff does not touch their code.
| } | ||
| checkHTTPSource(fail, field, source) | ||
| // An import has no request schema to cap it (maxLength on CustomHTTPAPI.base_url). | ||
| if endpoint := m.Endpoints[source.Endpoint]; len(endpoint) > maxHTTPPath { |
There was a problem hiding this comment.
[Should fix] (unchanged code) The lower side of this cap is not pinned: >= maxHTTPPath survives. A base_url of exactly 2048 bytes is accepted on head. Ready row: HTTPSourceSuite success case with endpoint "https://api.example.com/" + strings.Repeat("a", 2024), expect Validate() to return no error. Same gap at core/custom.go:44; see the body. Policy: ticket.
There was a problem hiding this comment.
Fixed in ed754e9: HTTPSourceSuite/TestAValidHTTPSourceIsAccepted row "a base_url of 2048 bytes" and ImportableDefinitionSuite/TestAnHTTPConnectorAndAnMCPOneAreKept (2048-byte base_url, kept as stored). Both pass on the head and fail under >= maxHTTPPath at core/manifest.go:836 and core/custom.go:44. Test-only change.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
kanat
left a comment
There was a problem hiding this comment.
VERDICT: GO
Delta round 3 on PR #2344 (AI-3676). Head ed754e9, previous reviewed head be026ba. Merged onto base 5a798ad (feature/ai-3669-http-connectors, unchanged): no merge needed, the base is an ancestor of the head.
The delta is one commit, ed754e9 (R2.2). It touches two test files (+8/-1) and no production line:
- acceleration/internal/connectors/core/http_tools_test.go: row "a base_url of 2048 bytes" in TestAValidHTTPSourceIsAccepted.
- acceleration/internal/store/datamove_unit_test.go: third row, a 2048-byte import, in TestAnHTTPConnectorAndAnMCPOneAreKept.
Prior findings
- R2.2 fixed. Both new rows fail under their
>=mutant and pass on head (see MUTATIONS). - R2.1(a), (b), (c): not touched by this delta. Status as in delta-2; the mutants were not re-run this round.
- S1.1, S1.2/R1.5, S1.3, R1.1 to R1.4: not touched by this delta. Status as in delta-1; not re-run this round.
New findings
None. Both rows sit at the cap: the lengths are 2048 bytes (core: 24 + 2024; store: 16 + 2032, counted with python3), so they pin the lower side of maxHTTPPath, and the 2049 rows from R2.1 pin the upper side.
Mutations
2 checked, 0 survived.
- core/manifest.go:836
len(endpoint) > maxHTTPPathchanged to>=. Fails: TestHTTPSourceSuite/TestAValidHTTPSourceIsAccepted, row "a base_url of 2048 bytes" (error "endpoints.http: is over 2048 bytes"). Also fails: TestImportableDefinitionSuite/TestAnHTTPConnectorAndAnMCPOneAreKept. Head: passes. - core/custom.go:44
len(baseURL) > maxHTTPPathchanged to>=. Fails: TestImportableDefinitionSuite/TestAnHTTPConnectorAndAnMCPOneAreKept, the 2048-byte row (error "base_url must be a public https URL without userinfo, query or fragment"). The core suite still passes, as expected: it does not reach custom.go. Head: passes.
Each mutant was reverted with git checkout; the worktree was clean afterwards.
Runs (head ed754e9, unit only)
go test -count=1 ./internal/connectors/... ./internal/store/: every package ok (store 8.7 s).go vet ./internal/connectors/... ./internal/store/: exit 0.gofmt -lon the two test files: no output.- No integration run. The changed store file has no build tag, so the unit run covers it. No integration suite touched by this delta.
CI
gh pr checks 2344: the PR is a draft, so go, unit, integration and sdks skip. labeler and GitGuardian pass. A draft runs no CI, which is not a failure.
aed810a
into
feature/ai-3669-http-connectors
Targets the feature branch `feature/ai-3669-http-connectors`, not
`main`. Fix leaf of AI-3669 (umbrella AI-3870).
## Why
With http connectors stored, `GET /v1/agents/connectors[/{id}]` answered
a `Connector` with no source kind, so the CLI could not tell an http
custom connector from an MCP one. The cli#128 review showed it: `agents
mcp list` lists http connectors as MCP servers, and `agents mcp update
<http one> <mcp url>` with no local file turned an http connector into
an MCP one. The CLI already decodes `sources: [{kind}]` (GetStream/cli
`internal/agents/connectors.go:21`); this makes the router answer it.
## How it works
```
Connector (GET /v1/agents/connectors, /{id}, the create's answer)
└─ sources: one entry per manifest source, in order, kind only
├─ custom, made from `endpoint` -> [{"kind":"mcp"}]
├─ custom, made from `http` -> [{"kind":"http"}]
├─ built-in -> its own kinds (slack: [{"kind":"mcp"}])
└─ never a URL, base_url, path, headers or tool
```
`kind` is the named enum `ConnectorSourceKind` (`mcp` | `http`), with
`x-enum-varnames` so the Go SDK gets `ConnectorSourceKindMCP` and
`ConnectorSourceKindHTTP` and a later enum holding `mcp` or `http`
renames nothing (as #2344 did for `CustomHTTPToolMethod`). `sources` is
always an array, `nullable: false`.
## Changes
| Change | Test that proves it |
| --- | --- |
| `Connector.sources` built from `manifest.Sources` by kind
(`connectors.go` `connectorOf`) | `TestConnectorSourcesSuite` (order,
empty list is `[]`, nothing but kind);
`TestAConnectorShowsItsSourceKindAndNoAddress` (create, read, list of an
http and an MCP custom connector, and slack; no `base_url`, `endpoint`,
address, path or tool name in the answer) |
| Two controls that listed the keys of a connector answer gain `sources`
| `TestAnMCPConnectorIsAnsweredAsBefore`,
`TestABuiltInReadsAsBeforeOnARouterWithoutAPublicURL`;
`TestWhatTheRouterReadsToConnectIsNeverShown` no longer withholds
`sources` but asserts it is `[{kind: mcp}]` |
| `openapi.yaml` and the clients regenerated | Go, JS, Python
(`plugins/stream`), .NET, Ruby, Rust and PHP changed; Kotlin, Swift and
Dart checked, unchanged (`Connector` is not client-accessible) |
| Go constant names pinned | `TestConnectorSourceKindNamesItsConstants`
(`sdks/go/acceleration/enums_test.go`) |
| SDK note appended | `.claude/skills/sdk/notes/2026-11-24-ai-3676.md` |
## Validation
- `go test ./internal/api/` (unit) and, on my own test DB, `go test
-tags integration -run
'TestConnectorsSuite|TestAuthorizationsSuite|TestConnectionsSuite|TestConnectionProxySuite|TestConnectorProviderAppsSuite|TestConnectorEventsSuite|TestDataMoveSuite|TestOAuthClientsSuite|TestConfigsSuite'
./internal/api/` pass; `go vet` with and without `-tags integration`
clean; `go test ./acceleration/` in `sdks/go` passes.
- Mutations: loop body dropped, kind hardcoded, nil instead of empty
list, endpoint appended to the kind, reversed order (each killed by
`TestConnectorSourcesSuite`); enum value dropped, varnames dropped,
`nullable:"false"` dropped (each killed by `TestPostureSuite`, the spec
check; the varnames one also fails `enums_test.go` after `go generate`).
- Not run here: the full integration run, Swift/Kotlin/Dart tests, the
CLI side (cli#128).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
…871 (#2480) Targets `feature/ai-3669-http-connectors`, not main. Two small leftovers of AI-3669; tests and docs only, no router code changes. ``` acceleration/internal/api/child_agents_sensitive_test.go +TestADelegationJudgesAnHTTPToolReadOnlyOnlyAtTheDigestItsGrantPins .claude/skills/sdk/notes/2026-11-24-ai-3676.md Connector sentence true again .claude/skills/sdk/notes/2026-11-25-ai-3871.md new: the AI-3871 `sources` note, moved here ``` ## 1. Delegation judges an http tool by its pinned digest `bindingSendsOut` (`sensitive.go`) calls `GrantSendsOut`, which judges an http tool at the digest its grant pins. Replacing that call with `manifest.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 has `get`, a read-only GET: | grant | sensitive parent, http child | sensitive child, http parent | |---|---|---| | pins the digest | runs | runs | | pins none | refused | refused | | pins another digest | refused | refused | Mutants (one script, `mutate.sh`): `bindingSendsOut` -> `SendsOutTool`, `digest != grant.SchemaDigest` -> `digest == ""` and `-> digest == grant.SchemaDigest` each fail the test; the head passes. ## 2. SDK notes #2464 appended the AI-3871 part to the AI-3676 note; `notes/README.md` asks one file per change, and the AI-3676 note said the `Connector` is unchanged. The AI-3871 paragraph is now `2026-11-25-ai-3871.md` unchanged; the AI-3676 note is back as #2344 wrote it, except that its `Connector` sentence says "unchanged by this change" and points to the new note. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 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 the feature branch
feature/ai-3669-http-connectors, notmain. Leaf 4 of 4 in the router for AI-3669 (the keystone): until it merges, no API stores an http connector.Why
The CLI writes
connectors/http/<name>.yaml(base_url + tools), and the router can run such tools since leaves 1-3 (#2316 manifest, #2324 call-time safety).POST /v1/agents/connectorstook only an MCPendpoint, and AI-3674 madePOST /v1/data/importrefuse an http connector until this leaf. The AI-3674 reviews asked for two things:base_urlis checked withegress.ValidatePublicHTTPSURLon create and on every new revision (S1.5), and import and create open at the same time with the same checks (R1.1).How it works
The request shape:
The base_url is checked before the manifest's rules, so
http://..., a{name}in it or one over 2048 gets the fixed message too (core would answer it in its own words), on create and on import alike. The schema carries core's caps and tool name pattern, and core holds them as well (a parameter's description and the base_url included), so an import, which has no request schema, stores nothing the API would refuse. Egress's own error never reaches the caller on create or import: it tells a name that does not resolve from a private one.Changes
internal/api/connectors.go:httpbesideendpointonCustomConnectorRequest(newCustomHTTPAPI,CustomHTTPTool,CustomHTTPParameter, each refusing unknown fields);customManifestchecks exactly-one and the base_url, then builds throughcore.CustomManifest.createConnectoris untouched, so [AI-3663] Keep the last synced hash for connectors and routers #2302 (ReviseSynced) merges beside it.internal/connectors/core:CheckBaseURL, the one base_url check create and import share;Manifest.Validatecaps a parameter's description (1000) and the http endpoint (2048).internal/store/datamove.go:importableDefinitiontakesctxand checks an http connector's base_url in place of AI-3674's refusal;importableRowchecks a definition beforeimportRow, andapplyChangesruns it for the whole change set before its transaction.x-enum-varnames), so the Go SDK keepsArray,Boolean,Null,Number,ObjectandString;sdks/go/acceleration/enums_test.gopins them.api/openapi.yamland the Go, JS, Python, .NET, Ruby, Rust and PHP clients regenerated; Kotlin, Swift and Dart generate nothing new (createConnectoris not client-accessible)..claude/skills/sdk/notes/2026-11-24-ai-3676.md;connectorsandadd-connectorskills namehttp;sources/http/AGENTS.mdsays who stores an http connector now.Validation
ConnectorsSuite/TestACustomHTTPConnectorIsStoredAndItsAPIIsNeverShownConnectorsSuite/TestAConnectionToAnHTTPConnectorListsItsReadOnlyToolConnectorsSuite/TestAReadOnlyToolThatWritesIsRefusedNamingItConnectorsSuite/TestAnHTTPConnectorWhoseAPIIsNotPublicHTTPSIsRefusedConnectorsSuite/TestANewRevisionOfAnHTTPConnectorIsCheckedAgainConnectorsSuite/TestAConnectorWithBothOrNeitherOfEndpointAndHTTPIsRefusedvalidation_failedConnectorsSuite/TestAnHTTPToolTheSchemaRefusesIsAValidationFailure_method)ConnectorsSuite/TestAnHTTPConnectorTheManifestRefusesIsRefusedWithItsReasonConnectorsSuite/TestAnMCPConnectorIsAnsweredAsBefore(passes on base and head)HTTPSourceSuite/TestAnHTTPSourceBreakingARuleIsRefused,ImportableDefinitionSuite/TestAnOversizedHTTPConnectorIsRefusedstore DataMoveSuite/TestAChangesDefinitionsAreCheckedBeforeItsTransactionOpenssdks/go/accelerationTestInvocationArgumentTypeKeepsItsConstantNames,TestCustomHTTPToolMethodNamesItsConstantsImportableDefinitionSuite,store DataMoveSuite/TestAnImportedHTTP*,api DataMoveSuite/TestAnImportedHTTPConnectorIsCheckedAsTheAPIChecksItThe AC tests fail on the base (run there with this branch's test file), except the schema test, which the base also passes by refusing
httpas an unknown field. Each changed condition, field copy and schema tag was mutated; the list is in the author log.Open points
CustomConnectorRequest.Endpointis*string, Rust'sendpointisOption<String>, and PHP's and Python's constructors takeendpointafterschemes.🤖 Generated with Claude Code