paperclipai/paperclip · error
Invalid Teams consent scope
Error message
Invalid Teams consent scope
What it means
Binding guard in the seal method of the Teams file-consent event: the consent event being sealed does not match the provided binding — either consentEventMatches failed, or the context's companyId/endpointId differ from the binding's. It prevents sealing a Teams file consent token for a scope (company/endpoint/event) other than the one that originally granted it.
Source
Thrown at server/src/services/chat-teams-file-consent.ts:586
? "none"
: typeof upload === "string"
? upload
: "available";
Object.freeze(this);
}
isHookEvent() {
return this.#authentic;
}
async seal(
context: TeamsFilePrivateContext,
binding: TeamsFileConsentBinding,
) {
if (
!consentEventMatches(this, binding) ||
context.companyId !== binding.companyId ||
context.endpointId !== binding.endpointId
)
throw new Error("Invalid Teams consent scope");
return sealPrivate(context, "response", {
bindingDigest: digest(binding),
activityId: this.activityId,
action: this.action,
replyToId: this.replyToId,
upload: this.#upload,
});
}
receiptDigest() {
return digest({
activityId: this.activityId,
action: this.action,
replyToId: this.replyToId,
upload: this.#upload,
});
}
static async restore(
context: TeamsFilePrivateContext,View on GitHub (pinned to 01ad858492)
Solutions
- Pass the consent binding that matches the original Teams consent event (same companyId, endpointId, and event match)
- Re-request user consent if the binding legitimately changed (new endpoint or company)
- Check for stale cached bindings being reused across endpoints
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at server/src/services/chat-teams-file-consent.ts:586 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-09-10).
Data as JSON: /api/errors/c4bfd94ea4134803.
Report an issue: GitHub.