Skip to content

feat(brolga): point the client at Brolga's shipped API - #102

Merged
jusso-dev merged 3 commits into
mainfrom
feat/brolga-live-api
Jul 29, 2026
Merged

feat(brolga): point the client at Brolga's shipped API#102
jusso-dev merged 3 commits into
mainfrom
feat/brolga-live-api

Conversation

@jusso-dev

Copy link
Copy Markdown
Owner

Brolga's HTTP API now exists and serves the context pack this client was written against.

The change

Brolga versions its routes in the path under /api/v1, not /v1. normaliseBaseUrl reduces the configured URL to an origin on purpose ("path stripped so we control /v1/…"), so the full prefix belongs in the path constants, not in the base URL.

That is the whole functional change. The consumer contract in src/lib/brolga/types.ts was written well and needed no reshaping — Brolga's pack fills disposition, entities, claims, relationships, evidence, gaps, exclusions, and budget as the types already expected.

Verified against a real instance

Not mocked — a Brolga container on the homelab, reached over Tailscale, through safeFetch so the SSRF guard and DNS pinning are on the tested path:

health url : http://…:8787/api/v1/health
context url: http://…:8787/api/v1/context
health     : {"status":"ok","version":"0.1.0"}
disposition: malicious
entities   : [ 'C2 infrastructure' ]
evidence   : 1 source object(s)
gaps       : [ 'no sightings recorded; Brolga cannot say when this was last seen' ]
no token   : 401 as expected

Two deployment notes

The SSRF guard blocks a self-hosted Brolga. A tailnet or LAN address is non-public, so assertSafeOutboundUrl rejects it. KELPIE_ALLOW_PRIVATE_NETWORKS must be the literal string "true""1" silently does nothing, which cost me a debugging cycle. Now documented in .env.example.

disposition: "unknown" is not benign. It means Brolga has not heard of the subject. Rendering it as benign would close alerts that should be raised. Noted in the types.

Scope

scripts/live-brolga-check.ts is deliberately not wired into npm test: it needs a reachable instance and a token, which CI has neither of. npm run test:brolga-contract still passes and stays the no-network check.

🤖 Generated with Claude Code

Brolga's HTTP API now exists and serves the context pack this client was
written against. It versions routes in the path under `/api/v1`, not `/v1`,
so the two path constants move. `normaliseBaseUrl` reduces the configured URL
to an origin on purpose, so the prefix belongs here rather than in the base URL.

Verified against a real instance: health 200, a context lookup for an ingested
address returning `disposition: "malicious"` with a source object to cite, and
an unauthenticated request refused with 401. Driven through `safeFetch`, not
bare `fetch`, so the SSRF guard and DNS pinning are on the tested path.

Two notes for whoever deploys this:

- A self-hosted Brolga on a tailnet or LAN resolves to a non-public address and
  the outbound guard blocks it. `KELPIE_ALLOW_PRIVATE_NETWORKS` must be the
  literal string "true" — "1" silently does nothing. Documented in .env.example.
- Brolga serves detail level L1 and reports the level it actually served, with
  the shortfall in `exclusions`. A pack never claims more depth than it has.

`disposition: "unknown"` means Brolga has not heard of the subject. It is not
benign and must not be rendered as one.

`scripts/live-brolga-check.ts` is deliberately not wired into npm test: it needs
a reachable instance and a token, which CI has neither of.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jusso-dev, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 35 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 34dc7d3a-5ade-43c2-8440-29c5717e1cdd

📥 Commits

Reviewing files that changed from the base of the PR and between cc02481 and 86ff647.

📒 Files selected for processing (7)
  • .env.example
  • scripts/live-brolga-check.ts
  • scripts/test-brolga-contract.ts
  • src/lib/brolga/client.ts
  • src/lib/brolga/config.ts
  • src/lib/brolga/types.ts
  • src/lib/enrichment/providers/brolga.ts

Comment @coderabbitai help to get the list of available commands.

jusso-dev and others added 2 commits July 29, 2026 16:18
The comment said Brolga's HTTP API was planned and that calls report
"unavailable" until then. It ships, and they do not.

Also records that KELPIE_ALLOW_PRIVATE_NETWORKS must be the literal "true":
"1" leaves the guard on and the call fails with a message about a non-public
address, which reads like a network fault rather than a config one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The repo's tsconfig does not set allowImportingTsExtensions, so the .ts
suffixes failed the typecheck job even though tsx ran the script fine. Uses
@/lib/brolga like the other scripts do.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jusso-dev
jusso-dev merged commit a608eb2 into main Jul 29, 2026
4 checks passed
@jusso-dev
jusso-dev deleted the feat/brolga-live-api branch July 29, 2026 08:14
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.

1 participant