Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

ai-harness: an input with no principal runs with the owner session's principal

Abierto
#1,797 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@tombeckenham ya está trabajando en esto.

Desde el 15/10/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

waiting-on: maintainer
TanStack AI version

@tanstack/ai-harness on the feat/harness-core branch, with #1780 (not released yet).

Framework/Library version

Node 24.8.0. No UI framework: the bug is in the durable host.

Describe the bug and the steps to reproduce it

An input that has no principal runs with the principal of the owner's session. So an anonymous input can get the credentials and provider keys of another user.

How it happens with #1780:

  1. Host B opens a thread with no principal. Host A opened the same thread with principal alice, and owns it.
  2. Host B gets an input. It stores it in stores.inbox with no principal.
  3. Host A applies it in applyForwarded (packages/ai-harness/src/session/base.ts). With no principal, prompt() uses options?.principal ?? this.principal, which is alice.

The same fallback runs today when a session recovers a logged input that has no principal, so this is not new to #1780. But forwarding makes it reachable across hosts.

Possible fixes:

  • Store a principal on every input. Refuse an input with no principal on a host that has an authorizer.
  • Add a way to say "no principal" on prompt and the other inputs, so the owner does not fall back to its own.

This needs a decision on the public API, so it is an issue and not a change in #1780.

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

packages/ai-harness/tests/forwarding.test.ts on #1780 has the two-host setup (sharedStores()). Open the owner with principal: { id: 'alice' } and the other host with no principal. Then check which principal a tool sees in a turn sent from the other host.

Do you intend to try to help solve this bug with your own PR?

Maybe, I'll investigate and start debugging

Terms & Code of Conduct
  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
Lenguaje dominante
TypeScript
Estrellas
3.2k
Forks
365
Merge medio
1 d 8 h
PR fusionados (30 d)
261

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de TanStack/ai

Todos los issues de TanStack/ai

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.