mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-24 10:13:11 +02:00
fix: propagate denied low-trust issue policy
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
2b2f525352
commit
18fd6e262c
2 files changed
+30
No files matched your search
@@ -572,6 +572,33 @@ describeEmbeddedPostgres("low-trust red-team HTTP route regression suite", () =>
|
||||
});
|
||||
});
|
||||
|
||||
it("propagates denied low-trust policy conflicts on control-plane guards", async () => {
|
||||
const fixture = await seedLowTrustFixture(db);
|
||||
const conflictingExecutionPolicy = {
|
||||
authorizationPolicy: {
|
||||
trustBoundary: {
|
||||
mode: LOW_TRUST_REVIEW_PRESET,
|
||||
companyId: fixture.company.id,
|
||||
rootIssueId: fixture.issues.siblingOutOfScope.id,
|
||||
},
|
||||
},
|
||||
};
|
||||
await db.update(heartbeatRuns)
|
||||
.set({
|
||||
contextSnapshot: {
|
||||
issueId: fixture.issues.assignedReview.id,
|
||||
executionPolicy: conflictingExecutionPolicy,
|
||||
},
|
||||
})
|
||||
.where(eq(heartbeatRuns.id, fixture.runs.lowTrust.id));
|
||||
|
||||
const res = await request(createApp(db, agentActor(fixture)))
|
||||
.get(`/api/issues/${fixture.issues.assignedReview.id}/approvals`);
|
||||
|
||||
expect(res.status, JSON.stringify(res.body)).toBe(403);
|
||||
expect(res.body.error).toBe("Low-trust boundary root issue scopes do not overlap.");
|
||||
});
|
||||
|
||||
it("restricts low-trust self inspection without changing standard-agent visibility", async () => {
|
||||
const fixture = await seedLowTrustFixture(db);
|
||||
|
||||
|
||||
@@ -1040,6 +1040,9 @@ export function issueRoutes(
|
||||
agentId: req.actor.agentId,
|
||||
runId: req.actor.runId,
|
||||
}, companyId, issue);
|
||||
if (resolution?.kind === "denied") {
|
||||
throw forbidden(resolution.detail);
|
||||
}
|
||||
return resolution?.kind === "low_trust_review";
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user