Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/0020-fix-redteam-properties-add-value.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cdot65/prisma-airs-cli": patch
---

Fixed `airs redteam properties add-value` returning HTTP 422 by sending `property_name`/`property_value` (matching the SDK schema) instead of `name`/`value`.
5 changes: 4 additions & 1 deletion src/airs/promptsets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ export class SdkPromptSetService implements PromptSetService {
}

async createPropertyValue(name: string, value: string): Promise<PropertyValue> {
const response = await this.client.customAttacks.createPropertyValue({ name, value } as never);
const response = await this.client.customAttacks.createPropertyValue({
property_name: name,
property_value: value,
});
return response as unknown as PropertyValue;
}
}
6 changes: 3 additions & 3 deletions tests/unit/airs/promptsets.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,13 @@ describe('SdkPromptSetService', () => {
});

describe('createPropertyValue', () => {
it('creates and returns property value', async () => {
it('sends property_name/property_value matching SDK schema', async () => {
mockCreatePropertyValue.mockResolvedValue({ name: 'category', value: 'compliance' });
const result = await service.createPropertyValue('category', 'compliance');
expect(result).toEqual({ name: 'category', value: 'compliance' });
expect(mockCreatePropertyValue).toHaveBeenCalledWith({
name: 'category',
value: 'compliance',
property_name: 'category',
property_value: 'compliance',
});
});
});
Expand Down
Loading