Skip to content
Centriu
Centriu Run

AI-Chat Command Authentication Integrity Automation: Every Question Answered With HTTP 401, Zero Rows in the History Table

Centriu Run's natural-language operations command feature — a chat box meant to answer questions about the operation using an AI backend — failed on every single question asked to it, since the day its underlying edge function was renamed from an earlier, related feature. The cause: the frontend's request to that edge function was missing both of the two authentication headers the function requires, lost silently during that earlier rename. Because the edge function enforces authentication before running any of its own logic, every request was rejected with HTTP 401 before the AI backend was ever reached — the interface always displayed a generic "Error: HTTP 401" and nothing else. The proof this was total, not partial: the history table the function writes to on every successfully answered question had exactly zero rows, meaning literally no question had ever been answered through this interface. Orphaned, unused imports for the exact functions needed to build those headers were still sitting in the file — direct evidence the header-sending code once existed and was deleted by accident, not that it was never written. The fix restores both headers and additionally preserves the server's own specific error detail, rather than a bare status code, so a future failure is diagnosable rather than uniformly opaque.
Zero rows proved 100% failure
Real errors now, not a bare code
Customer service team member wearing a headset, smiling
Zero rows in the history table — every question, rejected.

Why a feature that always fails the same way is invisible in exactly the wrong way

A feature that fails loudly and inconsistently gets noticed and reported quickly — someone hits an error, describes it, and it gets triaged. A feature that fails the exact same way every single time, from the very first day it shipped, is a different and more dangerous kind of invisible: there's no "it used to work" moment to notice, no intermittent success to contrast the failure against, and a person trying it once and seeing a generic error message has no way to tell whether the feature is fundamentally broken or whether they simply asked a bad question. The failure blends into the background as "this feature apparently doesn't work well," rather than surfacing as the specific, fixable defect it actually is.

How the underlying problem shows up before you fix it

A chat-style feature answers every single question with the same generic error, regardless of what was asked.

A dedicated history table meant to log every successfully answered question has zero rows, despite the feature having existed and been reachable for some time.

Two unused, orphaned imports for authentication-header-building functions remain in a file whose current code never calls them — a signature of something removed rather than never written.

An authenticated backend endpoint appears completely broken from the outside, when in fact its own internal logic works fine and has simply never been reached at all.

An error message reports only a bare HTTP status code, giving no way to distinguish "the request is malformed" from "you've hit a usage limit" from "the request never had valid credentials in the first place."

Why an authentication check that runs FIRST makes a header omission total, not partial

An endpoint that enforces authentication before running any of its own business logic is doing exactly what a secure endpoint should do — reject an unauthenticated caller immediately, before spending any compute on a request that was never going to be allowed through anyway. That correct design choice has a specific consequence when the CALLING code accidentally omits the credentials it's supposed to send: the failure becomes total and uniform. There's no partial success, no "it works for simple questions but not complex ones" — every single call fails at the exact same gate, for the exact same reason, which paradoxically makes the defect harder to diagnose from the outside precisely because the failure never varies.

How Centriu Run found and fixed a defect measured at exactly zero successful executions

The defect was discovered as part of a wider audit of Run's infrastructure settings screens, and its root cause traces to an earlier, unrelated refactor: the natural-language command feature's edge function had been renamed from an older, related function used for a different purpose, and during that rename, the two headers the calling code needs to send — an API key header and a bearer authorization token — were dropped from the fetch call. Because the target edge function runs with strict JWT verification enabled, meaning it authenticates the caller before executing a single line of its own logic, every request arriving without valid credentials was rejected immediately with HTTP 401.

The proof this was a complete, 100% failure rather than an intermittent one is direct and measurable: the database table the edge function writes a row to on every successfully processed question had exactly zero rows. Not a low number, not a recent gap — zero, for the entire time the feature had been reachable. Compounding the diagnosis, the two now-unused import statements for the exact functions needed to construct those missing headers were still present in the file, unreferenced by any code — a clear signature that the header-sending logic used to exist in this file and was deleted, most likely by accident during the rename, rather than the feature having shipped incomplete from the start.

The fix restores both headers to the request: the API key header set to the project's public anonymous key, and the bearer authorization header set to the user's own stored access token when one exists (falling back to the anonymous key otherwise, matching the same pattern already used by a comparable feature elsewhere in the product). The fix goes one step further than restoring bare functionality: where the request previously threw a bare, unadorned HTTP status code with no further detail, it now attempts to read and include the server's own error message (capped at 200 characters) in the thrown error — specifically so that a future failure, whatever its cause, arrives as a diagnosable message rather than a status code that looks identical whether the actual problem is an AI usage quota, a malformed question, or something else entirely.

What is actually built today

Both required authentication headers (API key and bearer authorization token) restored on every request to the natural-language command edge function.

The user's own stored access token used when available, falling back to the anonymous key — the same authentication pattern already used by a comparable feature elsewhere in the product.

Error messages that now preserve the server's own specific detail (up to 200 characters) instead of reporting a bare, undifferentiated status code.

A defect measured with hard evidence before the fix — a dedicated history table with exactly zero rows, proving total rather than partial failure — rather than treated as a suspected or theoretical issue.

The root cause traced to a specific prior refactor (a rename from a different, related edge function) and confirmed via orphaned, unused imports left behind in the file, rather than guessed at.

No change to the underlying AI backend or its own logic — the fix is scoped entirely to the authentication headers on the calling request, since the backend itself was never actually being reached before the fix.

A question that finally reaches the backend (illustrative scenario, not a real client)

Someone opens the operations command box and asks a plain-language question about the current workload. Before the fix, this always produced the same generic "Error: HTTP 401," regardless of the question — the request never got past the edge function's own authentication check. After the fix, the same question reaches the AI backend, gets a real answer, and is logged as a genuine row in the history table for the first time.

What changes operationally

A feature that had answered zero questions since it shipped now genuinely answers them, with every request actually reaching the backend it was always meant to reach. And because the fix also preserves the server's own error detail rather than a bare status code, a future failure — a usage limit, a malformed request, anything else — now arrives as something a person can actually act on, rather than the same uninformative message this feature always produced before.

When this is not the right fit

This is a fix to an authentication defect that made an existing feature completely non-functional — it does not add new capabilities to the natural-language command feature's own underlying logic, which was never the actual problem. A team expecting new question types or expanded scope from this specific fix will not find that here; what changed is that the feature's existing scope is now actually reachable.

A generic status code vs. an error that says what actually happened

Reporting a bare HTTP status code on failure treats every possible cause the same way — a missing credential looks identical to a usage-quota limit, which looks identical to a malformed request. Centriu Run's fix specifically preserves the backend's own error detail in what gets thrown to the user, so that whatever causes a future failure, the resulting message actually distinguishes it from every other possible cause, rather than repeating the same uninformative code regardless of what actually went wrong.

Related systems

Main system: Centriu Run.

What it does NOT do

  • Does not change or expand the natural-language command feature's own underlying logic or question scope — the fix is scoped entirely to restoring the authentication headers the calling request needs, since the backend logic itself was never being reached before the fix.
  • Does not report a bare, undifferentiated status code on failure anymore — the server's own specific error detail (up to 200 characters) is now preserved and surfaced.
  • Does not treat this as an unmeasured or suspected defect — a dedicated history table with exactly zero rows proved the failure was total, for the entire time the feature had been reachable, before the fix.
  • Does not leave the root cause unexplained — the defect is traced to a specific prior refactor (a rename from a different, related edge function) and confirmed via orphaned, unused imports left behind in the file.
  • Does not bypass the edge function's own authentication enforcement — the fix supplies the credentials the function always correctly required, rather than weakening the check itself.
  • Does not silently retry or work around an authentication failure — a genuinely failed request still fails, now with a specific, readable reason rather than a bare code.

Security and governance

The fix supplies the exact credentials — the project's public anonymous key and, where available, the user's own stored access token — that the target edge function's existing strict authentication check always required; no authentication requirement was loosened or bypassed to restore functionality. Any personal or business data referenced in a command-layer question or answer remains subject to Brazil's LGPD (Law No. 13,709/2018). Full detail on access control lives at /governanca and /iso.

Pricing and contracting

Available by monthly subscription, with tiered plans. Values and terms come from the official pricing table at /precos (Centriu's central source — never restated here).

Frequently asked questions

How was this proven to be a total, not partial, failure?

The database table the edge function writes to on every successfully answered question had exactly zero rows, for the entire time the feature had been reachable — direct, measurable evidence rather than an inference.

What actually caused every question to fail?

Two required authentication headers were dropped from the request during an earlier, unrelated rename of the underlying edge function — the function's own strict authentication check then rejected every request before its logic ever ran.

How do we know the headers were removed by accident, not just never written?

The exact import statements needed to build those headers were still present in the file, unused by any remaining code — a direct signature of code that used to exist and was deleted.

Does the fix change what kinds of questions the feature can answer?

No — the fix is scoped entirely to restoring the authentication headers on the request. The underlying AI backend and its logic were never the actual problem, since they were never being reached at all.

What happens now when a request genuinely fails for some other reason?

The thrown error now includes the server's own specific detail (up to 200 characters) instead of a bare status code, so a future failure is diagnosable rather than uniformly opaque.

What does Centriu Run cost?

It is sold by subscription with a published starting price — exact current values are on the central pricing page.

See how Centriu Run keeps its AI-chat command feature genuinely reachable

Reach our commercial team directly, or leave your details below — we'll follow up with guidance for your case.

Sources

  1. Centriu Run — public product page — Centriu, 2026-07-20 · link(primária)
  2. Centriu Run — public factsheet (API, JSON) — Centriu, 2026-07-21 · link
  3. Law No. 13,709/2018 — Brazil’s General Data Protection Law (LGPD) — Presidência da República (Brazil), 2018-08-14 · link

Last material update on .

By · AI-assisted production, with human review