diff --git a/.changeset/0190-red-team-languages-target-errorlog.md b/.changeset/0190-red-team-languages-target-errorlog.md new file mode 100644 index 0000000..588e35c --- /dev/null +++ b/.changeset/0190-red-team-languages-target-errorlog.md @@ -0,0 +1,10 @@ +--- +'@cdot65/prisma-airs-sdk': minor +--- + +Add Red Team supported-languages and target-profile error-log endpoints to `RedTeamClient`: + +- `getLanguages()` / `getManagementLanguages()` — the tenant's allowed languages for scans (`GET /v1/languages` on the data and management planes), returning `TenantLanguagesResponse` (`multilingual_enabled`, `supported_job_types`, `languages: { code, name }[]`). +- `getTargetProfileErrorLogs(targetId, opts?)` — profiling errors for a target (`GET /v1/error-log/target-profile/{target_id}`), reusing the existing `ErrorLogListResponse` shape. + +Also refreshes the committed Red Team OpenAPI specs to the latest upstream revision. diff --git a/docs-site/docs/guides/red-team-api.md b/docs-site/docs/guides/red-team-api.md index 779e965..389d751 100644 --- a/docs-site/docs/guides/red-team-api.md +++ b/docs-site/docs/guides/red-team-api.md @@ -622,6 +622,15 @@ const errors = await client.getErrorLogs('job-uuid', { limit: 50, }); +// Profiling error logs for a target (the endpoint honors `limit`) +const targetErrors = await client.getTargetProfileErrorLogs('target-uuid', { limit: 50 }); + +// Tenant's allowed languages for scans (data plane and management plane share the same shape) +const langs = await client.getLanguages(); +// { multilingual_enabled: true, supported_job_types: ['STATIC', 'DYNAMIC'], +// languages: [{ code: 'en', name: 'English' }, { code: 'es', name: 'Spanish' }] } +const mgmtLangs = await client.getManagementLanguages(); + // Update sentiment (thumbs up/down) for a scan report const sentiment = await client.updateSentiment({ job_id: 'job-uuid', diff --git a/specs/PaloAltoNetworks-AIRS-RedTeam-DataPlane.yaml b/specs/PaloAltoNetworks-AIRS-RedTeam-DataPlane.yaml index 1b6e8b2..9d08a8e 100644 --- a/specs/PaloAltoNetworks-AIRS-RedTeam-DataPlane.yaml +++ b/specs/PaloAltoNetworks-AIRS-RedTeam-DataPlane.yaml @@ -1,1427 +1,1705 @@ openapi: 3.1.0 info: title: Prisma AIRS Red Teaming Dataplane API - version: 0.5.20 - description: "Red Teaming Data Plane API - Data processing and scanning services\ - \ for AI/ML model security. \xA9 2025 Palo Alto Networks, Inc This Open API spec\ - \ file was created on February 25, 2026. \xA9 2026 Palo Alto Networks, Inc. Palo\ - \ Alto Networks is a registered trademark of Palo Alto Networks. A list of our\ - \ trademarks can be found at [https://www.paloaltonetworks.com/company/trademarks.html](https://www.paloaltonetworks.com/company/trademarks.html).\ - \ All other marks mentioned herein may be trademarks of their respective companies." + description: 'Red Teaming Data Plane API - Data processing and scanning services for AI/ML model security.' + version: 0.6.88 + termsOfService: https://www.paloaltonetworks.com/content/dam/pan/en_US/assets/pdf/legal/palo-alto-networks-end-user-license-agreement-eula.pdf + license: + name: MIT + url: https://opensource.org/license/mit + contact: + email: support@paloaltonetworks.com + name: Palo Alto Networks Technical Support + url: https://support.paloaltonetworks.com servers: - url: https://api.sase.paloaltonetworks.com/ai-red-teaming/data-plane security: -- bearerAuth: [] -components: - securitySchemes: - bearerAuth: - type: http - scheme: bearer - bearerFormat: JWT - schemas: - ApiEndpointType: - type: string - enum: - - PUBLIC - - PRIVATE - - NETWORK_BROKER - title: ApiEndpointType - description: API endpoint accessibility type. - AttackDetailResponseSchema: - properties: - uuid: - type: string - format: uuid - title: Uuid - tsg_id: - type: string - title: Tsg Id - job_id: - type: string - format: uuid - title: Job Id - description: Associated job UUID - target_id: - type: string - format: uuid - title: Target Id - description: Target UUID - prompt: - type: string - title: Prompt - description: The actual prompt text used - status: - $ref: '#/components/schemas/AttackStatus' - description: Attack status - default: INIT - marked_safe: + - bearerAuth: [] + +tags: + - name: Categories + description: Operations for managing scan categories. + - name: CustomAttack + description: Operations for custom attack configurations and prompts. + - name: Dashboard + description: Operations for dashboard data and statistics. + - name: ErrorLogs + description: Operations for retrieving and managing error logs. + - name: Languages + description: Operations for language configuration and multilingual support. + - name: Quota + description: Operations for quota management and limits. + - name: Report + description: Operations for generating and retrieving scan job reports for static and dynamic. + - name: Scan + description: Operations for creating and managing scan jobs. + - name: Sentiment + description: Operations for managing sentiment and scan report summaries. + - name: Templates + description: Operations for managing scan templates and configurations. + +paths: + /v1/scan: + post: + tags: + - Scan + summary: Create scan + description: Create a new scan target. + operationId: create_job_v1_scan_post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/JobCreateRequestSchema' + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/JobResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + get: + tags: + - Scan + summary: List scans + description: List jobs with filtering and pagination. + operationId: list_jobs_v1_scan_get + parameters: + - + name: limit + in: query + required: false + schema: + type: integer + maximum: 100 + minimum: 1 + description: Number of jobs to return (1-100) + default: 50 + title: Limit + description: Number of jobs to return (1-100) + - + name: skip + in: query + required: false + schema: + type: integer + minimum: 0 + description: Number of jobs to skip for pagination + default: 0 + title: Skip + description: Number of jobs to skip for pagination + - + name: status + in: query + required: false + schema: anyOf: - - type: boolean + - $ref: '#/components/schemas/JobStatusFilter' - type: 'null' - title: Marked Safe - description: Manual safety marking - extra_info: - additionalProperties: true - type: object - title: Extra Info - description: Additional metadata - threat: + description: Filter by job status + title: Status + description: Filter by job status + - + name: job_type + in: query + required: false + schema: anyOf: - - type: boolean + - $ref: '#/components/schemas/JobType' - type: 'null' - title: Threat - description: Threat detection result - attack_type: - $ref: '#/components/schemas/AttackType' - description: Type of attack - default: NORMAL - multi_turn: - type: boolean - title: Multi Turn - description: Multi-turn conversation flag - default: false - asr: + description: Filter by job type + title: Job Type + description: Filter by job type + - + name: search + in: query + required: false + schema: anyOf: - - type: number - maximum: 100 - minimum: 0 + - + type: string + maxLength: 255 - type: 'null' - title: Asr - description: Attack Success Rate (0-100) - version: + description: Search jobs by name + title: Search + description: Search jobs by name + - + name: target_id + in: query + required: false + schema: anyOf: - - type: integer + - + type: string + format: uuid - type: 'null' - title: Version - description: Attack version - prompt_mapping_id: + description: Filter by target UUID + title: Target Id + description: Filter by target UUID + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/JobListResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/scan/{job_id}: + get: + tags: + - Scan + summary: Get scan details + description: Get a job by its ID. + operationId: get_job_v1_scan__job_id__get + parameters: + - + name: job_id + in: path + required: true + schema: type: string format: uuid - title: Prompt Mapping Id - description: Prompt mapping UUID - prompt_id: - type: string - format: uuid - title: Prompt Id - description: Prompt UUID - category: - $ref: '#/components/schemas/Category' - description: Attack category - sub_category: - anyOf: - - $ref: '#/components/schemas/SecuritySubCategory' - - $ref: '#/components/schemas/SafetySubCategory' - - $ref: '#/components/schemas/BrandSubCategory' - - $ref: '#/components/schemas/ComplianceSubCategory' - title: Sub Category - description: Attack subcategory - severity: - type: string - description: Attack severity level - category_display_name: - type: string - title: Category Display Name - sub_category_display_name: - type: string - title: Sub Category Display Name - compliance_frameworks: - items: - $ref: '#/components/schemas/ComplianceWithTechniqueModel' - type: array - title: Compliance Frameworks - outputs: - items: - $ref: '#/components/schemas/AttackOutputSchema' - type: array - title: Outputs - description: Outputs for attacks - goal: - anyOf: - - type: string - - type: 'null' - title: Goal - type: object - required: - - uuid - - tsg_id - - job_id - - target_id - - prompt - - prompt_mapping_id - - prompt_id - - category - - sub_category - - category_display_name - - sub_category_display_name - - compliance_frameworks - - goal - title: AttackDetailResponseSchema - AttackListResponseSchema: - properties: - pagination: - $ref: '#/components/schemas/PaginationSchema' - data: - items: - $ref: '#/components/schemas/AttackListSchema' - type: array - title: Data - description: List of Attacks - type: object - required: - - pagination - - data - title: AttackListResponseSchema - description: Response schema for listing attacks following common pagination - pattern. - AttackListSchema: - properties: - uuid: - type: string - format: uuid - title: Uuid - tsg_id: - type: string - title: Tsg Id - job_id: + title: Job Id + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/JobResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/scan/{job_id}/abort: + post: + tags: + - Scan + summary: Abort scan + description: Abort a running job by cancelling its workflow and updating status. + operationId: abort_job_v1_scan__job_id__abort_post + parameters: + - + name: job_id + in: path + required: true + schema: type: string format: uuid title: Job Id - description: Associated job UUID - target_id: + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/JobAbortResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/categories: + get: + tags: + - Categories + summary: Get all categories with subcategories + description: Get all available categories with their subcategories. + operationId: get_all_categories_v1_categories_get + responses: + 200: + description: Successful Response + content: + application/json: + schema: + items: + $ref: '#/components/schemas/CategoryModel' + type: array + title: Response Get All Categories V1 Categories Get + 401: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/scan/scan-metadata: + get: + tags: + - Templates + summary: Get scan target metadata + description: Get the metadata for scan targets. + operationId: get_scan_metadata_v1_scan_scan_metadata_get + responses: + 200: + description: Successful Response + content: + application/json: + schema: + additionalProperties: true + type: object + title: Response Get Scan Metadata V1 Scan Scan Metadata Get + 401: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/report/static/{job_id}/list-attacks: + get: + tags: + - Report + summary: List attacks for a scan + description: List attacks with filtering and pagination. + operationId: list_attacks_v1_report_static__job_id__list_attacks_get + parameters: + - + name: job_id + in: path + required: true + schema: type: string format: uuid - title: Target Id - description: Target UUID - prompt: - type: string - title: Prompt - description: The actual prompt text used - status: - $ref: '#/components/schemas/AttackStatus' - description: Attack status - default: INIT - marked_safe: - anyOf: - - type: boolean - - type: 'null' - title: Marked Safe - description: Manual safety marking - extra_info: - additionalProperties: true - type: object - title: Extra Info - description: Additional metadata - threat: + title: Job Id + - + name: limit + in: query + required: false + schema: + type: integer + maximum: 100 + minimum: 1 + description: Number of attacks to return (1-100) + default: 50 + title: Limit + description: Number of attacks to return (1-100) + - + name: skip + in: query + required: false + schema: + type: integer + minimum: 0 + description: Number of attacks to skip for pagination + default: 0 + title: Skip + description: Number of attacks to skip for pagination + - + name: attack_status + in: query + required: false + schema: anyOf: - - type: boolean + - $ref: '#/components/schemas/AttackStatus' - type: 'null' - title: Threat - description: Threat detection result - attack_type: - $ref: '#/components/schemas/AttackType' - description: Type of attack - default: NORMAL - multi_turn: - type: boolean - title: Multi Turn - description: Multi-turn conversation flag - default: false - asr: + description: Filter by attack processing status + title: Attack Status + description: Filter by attack processing status + - + name: attack_type + in: query + required: false + schema: anyOf: - - type: number - maximum: 100 - minimum: 0 + - $ref: '#/components/schemas/AttackType' - type: 'null' - title: Asr - description: Attack Success Rate (0-100) - version: + description: Filter by attack type + title: Attack Type + description: Filter by attack type + - + name: category + in: query + required: false + schema: anyOf: - - type: integer + - $ref: '#/components/schemas/Category' - type: 'null' - title: Version - description: Attack version - prompt_mapping_id: - type: string - format: uuid - title: Prompt Mapping Id - description: Prompt mapping UUID - prompt_id: - type: string - format: uuid - title: Prompt Id - description: Prompt UUID - category: - $ref: '#/components/schemas/Category' - description: Attack category - sub_category: + description: Filter by attack category + title: Category + description: Filter by attack category + - + name: sub_category + in: query + required: false + schema: anyOf: - $ref: '#/components/schemas/SecuritySubCategory' - $ref: '#/components/schemas/SafetySubCategory' - $ref: '#/components/schemas/BrandSubCategory' - - $ref: '#/components/schemas/ComplianceSubCategory' + - type: 'null' + description: Filter by attack subcategory title: Sub Category - description: Attack subcategory - severity: - type: string - description: Attack severity level - category_display_name: - type: string - title: Category Display Name - sub_category_display_name: - type: string - title: Sub Category Display Name - type: object - required: - - uuid - - tsg_id - - job_id - - target_id - - prompt - - prompt_mapping_id - - prompt_id - - category - - sub_category - - category_display_name - - sub_category_display_name - title: AttackListSchema - AttackMultiTurnDetailResponseSchema: - properties: - uuid: - type: string - format: uuid - title: Uuid - tsg_id: - type: string - title: Tsg Id - job_id: - type: string - format: uuid - title: Job Id - description: Associated job UUID - target_id: - type: string - format: uuid - title: Target Id - description: Target UUID - prompt: - type: string - title: Prompt - description: The actual prompt text used - status: - $ref: '#/components/schemas/AttackStatus' - description: Attack status - default: INIT - marked_safe: - anyOf: - - type: boolean - - type: 'null' - title: Marked Safe - description: Manual safety marking - extra_info: - additionalProperties: true - type: object - title: Extra Info - description: Additional metadata - threat: + description: Filter by attack subcategory + - + name: compliance + in: query + required: false + schema: + anyOf: + - $ref: '#/components/schemas/ComplianceSubCategory' + - type: 'null' + description: Filter by compliance framework + title: Compliance + description: Filter by compliance framework + - + name: threat + in: query + required: false + schema: anyOf: - type: boolean - type: 'null' + description: '[Deprecated: use status] Filter by threat status' title: Threat - description: Threat detection result - attack_type: - $ref: '#/components/schemas/AttackType' - description: Type of attack - default: NORMAL - multi_turn: - type: boolean - title: Multi Turn - description: Multi-turn conversation flag - default: false - asr: + description: '[Deprecated: use status] Filter by threat status' + - + name: severity + in: query + required: false + schema: anyOf: - - type: number - maximum: 100 - minimum: 0 + - $ref: '#/components/schemas/SeverityFilter' - type: 'null' - title: Asr - description: Attack Success Rate (0-100) - version: + description: Filter by severity level + title: Severity + description: Filter by severity level + - + name: status + in: query + required: false + schema: anyOf: - - type: integer + - $ref: '#/components/schemas/StatusQueryParam' - type: 'null' - title: Version - description: Attack version - prompt_mapping_id: + description: 'Filter by status: SUCCESSFUL, FAILED, ERROR' + title: Status + description: 'Filter by status: SUCCESSFUL, FAILED, ERROR' + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AttackListResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/report/static/{job_id}/attack/{attack_id}: + get: + tags: + - Report + summary: Get attack details + description: Get detailed attack information including outputs and framework techniques. + operationId: get_attack_detail_v1_report_static__job_id__attack__attack_id__get + parameters: + - + name: job_id + in: path + required: true + schema: type: string format: uuid - title: Prompt Mapping Id - description: Prompt mapping UUID - prompt_id: + title: Job Id + - + name: attack_id + in: path + required: true + schema: type: string format: uuid - title: Prompt Id - description: Prompt UUID - category: - $ref: '#/components/schemas/Category' - description: Attack category - sub_category: - anyOf: - - $ref: '#/components/schemas/SecuritySubCategory' - - $ref: '#/components/schemas/SafetySubCategory' - - $ref: '#/components/schemas/BrandSubCategory' - - $ref: '#/components/schemas/ComplianceSubCategory' - title: Sub Category - description: Attack subcategory - severity: - type: string - description: Attack severity level - category_display_name: - type: string - title: Category Display Name - sub_category_display_name: - type: string - title: Sub Category Display Name - compliance_frameworks: - items: - $ref: '#/components/schemas/ComplianceWithTechniqueModel' - type: array - title: Compliance Frameworks - outputs: - items: - items: - $ref: '#/components/schemas/AttackMultiTurnOutputSchema' - type: array - type: array - title: Outputs - description: List of conversations, where each conversation is a list of - turns ordered by turn number. Each inner list represents one generation - of the multi-turn attack. - goal: - anyOf: - - type: string - - type: 'null' - title: Goal - type: object - required: - - uuid - - tsg_id - - job_id - - target_id - - prompt - - prompt_mapping_id - - prompt_id - - category - - sub_category - - category_display_name - - sub_category_display_name - - compliance_frameworks - - goal - title: AttackMultiTurnDetailResponseSchema - AttackMultiTurnOutputSchema: - properties: - uuid: + title: Attack Id + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AttackDetailResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/report/static/{job_id}/report: + get: + tags: + - Report + summary: Get attack library report + description: Get attack library report for a job. Raises ForbiddenError if report is partially complete and locked. + operationId: get_attack_report_v1_report_static__job_id__report_get + parameters: + - + name: job_id + in: path + required: true + schema: type: string format: uuid - title: Uuid - tsg_id: - type: string - title: Tsg Id - attack_id: + title: Job Id + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/StaticJobReportSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/report/static/{job_id}/runtime-policy-config: + get: + tags: + - Report + summary: Get attack library runtime security profile + description: Get Runtime security profile for a static job. + operationId: get_static_runtime_security_policy_config_v1_report_static__job_id__runtime_policy_config_get + parameters: + - + name: job_id + in: path + required: true + schema: type: string format: uuid - title: Attack Id - description: Associated attack UUID - job_id: + title: Job Id + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/RuntimeSecurityProfileResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/report/static/{job_id}/remediation: + get: + tags: + - Report + summary: Get attack library scan remediation + description: Get other remediation measures for a static job. + operationId: get_static_remediations_v1_report_static__job_id__remediation_get + parameters: + - + name: job_id + in: path + required: true + schema: type: string format: uuid title: Job Id - description: Associated job UUID - target_id: + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/RemediationResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/report/dynamic/{job_id}/report: + get: + tags: + - Report + summary: Get agent scan report + description: Get dynamic job report for a job. + operationId: get_dynamic_job_report_v1_report_dynamic__job_id__report_get + parameters: + - + name: job_id + in: path + required: true + schema: type: string format: uuid - title: Target Id - description: Target UUID - output: - type: string - title: Output - description: Attack output. String for single-turn, dict for multi-turn. - threat: - anyOf: - - type: boolean - - type: 'null' - title: Threat - description: Threat detection result - marked_safe: - anyOf: - - type: boolean - - type: 'null' - title: Marked Safe - description: Manual safety marking - prompt: - type: string - title: Prompt - description: User prompt for this turn - turn: - type: integer - title: Turn - description: Current turn number in multi-turn conversation - generation: - type: integer - title: Generation - description: Generation/conversation number (1-based) for grouping multi-turn - outputs - default: 1 - multi_turn: - type: boolean - title: Multi Turn - description: Multi-turn conversation flag - default: true - type: object - required: - - uuid - - tsg_id - - attack_id - - job_id - - target_id - - output - - prompt - - turn - title: AttackMultiTurnOutputSchema - description: Schema for multi-turn attack outputs. - AttackOutputSchema: - properties: - uuid: - type: string - format: uuid - title: Uuid - tsg_id: - type: string - title: Tsg Id - attack_id: + title: Job Id + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/DynamicJobReportSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/report/dynamic/{job_id}/runtime-policy-config: + get: + tags: + - Report + summary: Get agent scan runtime security profile + description: Get Runtime security profile for a dynamic job. + operationId: get_dynamic_runtime_security_policy_config_v1_report_dynamic__job_id__runtime_policy_config_get + parameters: + - + name: job_id + in: path + required: true + schema: type: string format: uuid - title: Attack Id - description: Associated attack UUID - job_id: + title: Job Id + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/RuntimeSecurityProfileResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/report/dynamic/{job_id}/remediation: + get: + tags: + - Report + summary: Get agent scan remediation + description: Get other remediation measures for a dynamic job. + operationId: get_dynamic_remediations_v1_report_dynamic__job_id__remediation_get + parameters: + - + name: job_id + in: path + required: true + schema: type: string format: uuid title: Job Id - description: Associated job UUID - target_id: + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/RemediationResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/report/dynamic/{job_id}/list-goals: + get: + tags: + - Report + summary: List agent scan goals + description: Get the goals for a job. + operationId: list_dynamic_job_goals_v1_report_dynamic__job_id__list_goals_get + parameters: + - + name: job_id + in: path + required: true + schema: type: string format: uuid - title: Target Id - description: Target UUID - output: - type: string - title: Output - description: Attack output. String for single-turn, dict for multi-turn. - threat: + title: Job Id + - + name: skip + in: query + required: false + schema: + type: integer + minimum: 0 + description: Number of goals to skip for pagination + default: 0 + title: Skip + description: Number of goals to skip for pagination + - + name: limit + in: query + required: false + schema: + type: integer + maximum: 100 + minimum: 1 + description: Number of goals to return (1-100) + default: 20 + title: Limit + description: Number of goals to return (1-100) + - + name: count + in: query + required: false + schema: + type: boolean + description: Include total count of goals + default: true + title: Count + description: Include total count of goals + - + name: status + in: query + required: false + schema: anyOf: - - type: boolean + - $ref: '#/components/schemas/StatusQueryParam' - type: 'null' - title: Threat - description: Threat detection result - marked_safe: + description: Filter by status + title: Status + description: Filter by status + - + name: goal_type + in: query + required: false + schema: anyOf: - - type: boolean + - $ref: '#/components/schemas/GoalTypeQueryParam' - type: 'null' - title: Marked Safe - description: Manual safety marking - type: object - required: - - uuid - - tsg_id - - attack_id - - job_id - - target_id - - output - title: AttackOutputSchema - description: Schema for attack output responses. - AttackStatus: - type: string - enum: - - INIT - - ATTACK - - DETECTION - - REPORT - - COMPLETED - - FAILED - title: AttackStatus - AttackType: - type: string - enum: - - NORMAL - - CUSTOM - title: AttackType - BrandSubCategory: - type: string - enum: - - COMPETITOR_ENDORSEMENTS - - BRAND_TARNISHING_SELF_CRITICISM - - DISCRIMINATING_CLAIMS - - POLITICAL_ENDORSEMENTS - title: BrandSubCategory - Category: - type: string - enum: - - SECURITY - - SAFETY - - COMPLIANCE - - BRAND - title: Category - CategoryModel: - properties: - id: - type: string - title: Id - description: Unique identifier - display_name: + description: Filter by goal type + title: Goal Type + description: Filter by goal type + - + name: search + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: Search string to filter goals + title: Search + description: Search string to filter goals + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/GoalListResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/report/dynamic/{job_id}/goal/{goal_id}/list-streams: + get: + tags: + - Report + summary: List agent scan goal deatils + description: Get streams for a specific goal in a job. + operationId: list_dynamic_job_streams_v1_report_dynamic__job_id__goal__goal_id__list_streams_get + parameters: + - + name: job_id + in: path + required: true + schema: type: string - title: Display Name - description: Frontend display name - description: - type: string - title: Description - description: Description - preselect: - type: boolean - title: Preselect - description: Whether this category should be preselected in UI - default: true - sub_categories: - items: - $ref: '#/components/schemas/SubCategoryModel' - type: array - title: Sub Categories - description: List of subcategories - type: object - required: - - id - - display_name - - description - - sub_categories - title: CategoryModel - description: Pydantic model for category data - CategoryReportSchema: - properties: - id: - type: string - title: Id - description: Unique identifier - display_name: - type: string - title: Display Name - description: Frontend display name - description: - type: string - title: Description - description: Description - preselect: - type: boolean - title: Preselect - description: Whether this category should be preselected in UI - default: true - sub_categories: - items: - $ref: '#/components/schemas/SubCategoryStatsSchema' - type: array - title: Sub Categories - description: Statistics per subcategory (e.g., ADVERSARIAL_SUFFIX, BIAS) - asr: - type: number - maximum: 100 - minimum: 0 - title: Asr - description: Attack success rate percentage - total_prompts: - type: integer - title: Total Prompts - description: Total unique prompts used - total_attacks: - type: integer - title: Total Attacks - description: Total attacks executed - successful: - type: integer - title: Successful - description: Total successful attacks - failed: - type: integer - title: Failed - description: Total failed attacks - type: object - required: - - id - - display_name - - description - - sub_categories - - asr - - total_prompts - - total_attacks - - successful - - failed - title: CategoryReportSchema - description: Security or Safety risk overview widget data. - ComplianceReportSchema: - properties: - id: - type: string - title: Id - description: Compliance framework unique identifier - display_name: - type: string - title: Display Name - description: Compliance framework display name for frontend - description: - type: string - title: Description - description: Compliance framework description - active: - type: boolean - title: Active - description: Whether compliance framework is active - version: - type: string - title: Version - description: Compliance framework version - link: - type: string - title: Link - description: Compliance framework documentation link - techniques: - items: - $ref: '#/components/schemas/ComplianceTechniqueSchema' - type: array - title: Techniques - score: - type: integer - title: Score - description: 'Compliance score: (1 - ASR%) % 5' - default: 0 - type: object - required: - - id - - display_name - - description - - active - - version - - link - - techniques - title: ComplianceReportSchema - ComplianceSubCategory: - type: string - enum: - - OWASP - - MITRE_ATLAS - - NIST - - DASF_V2 - title: ComplianceSubCategory - ComplianceTechniqueSchema: - properties: - id: - type: string - title: Id - description: Technique unique identifier - display_name: - type: string - title: Display Name - description: Technique display name for frontend - compliance_id: - type: string - title: Compliance Id - description: Associated compliance framework ID - description: - type: string - title: Description - description: Technique description - link: - type: string - title: Link - description: Technique documentation link - version: - type: string - title: Version - description: Technique version - active: - type: boolean - title: Active - description: Whether technique is active - successful: - type: integer - title: Successful - description: Number of successful attacks - default: 0 - failed: - type: integer - title: Failed - description: Number of failed attacks - default: 0 - total: - type: integer - title: Total - description: Total attacks for this technique - default: 0 - type: object - required: - - id - - display_name - - compliance_id - - description - - link - - version - - active - title: ComplianceTechniqueSchema - description: Compliance Technique Model - ComplianceWithTechniqueModel: - properties: - id: - type: string - title: Id - description: Compliance framework unique identifier - display_name: - type: string - title: Display Name - description: Compliance framework display name for frontend - description: - type: string - title: Description - description: Compliance framework description - active: - type: boolean - title: Active - description: Whether compliance framework is active - version: - type: string - title: Version - description: Compliance framework version - link: - type: string - title: Link - description: Compliance framework documentation link - techniques: - items: - $ref: '#/components/schemas/TechniqueModel' - type: array - title: Techniques - description: List of Techniques - type: object - required: - - id - - display_name - - description - - active - - version - - link - - techniques - title: ComplianceWithTechniqueModel - CountByNameSchema: - properties: - name: - type: string - title: Name - description: Name of the item (e.g., target type, status) - count: - type: integer - minimum: 0 - title: Count - description: Count of items - type: object - required: - - name - - count - title: CountByNameSchema - description: 'Generic count schema with name field for extensible list structures. - - - Used in dashboard and other endpoints to provide counts grouped by a name - field. - - Frontend-friendly list format for easy iteration. - - ' - CountedQuotaEnum: - type: string - enum: - - HELD - - COUNTED - - NOT_COUNTED - title: CountedQuotaEnum - description: Enum for counting Quota. - CustomAttackOutputSchema: - properties: - uuid: - type: string - format: uuid - title: Uuid - tsg_id: - type: string - title: Tsg Id - custom_attack_id: + format: uuid + title: Job Id + - + name: goal_id + in: path + required: true + schema: type: string format: uuid - title: Custom Attack Id - description: Associated custom attack UUID - job_id: - type: string - format: uuid - title: Job Id - description: Associated job UUID - target_id: + title: Goal Id + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/StreamListResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/report/dynamic/stream/{stream_id}: + get: + tags: + - Report + summary: List agent scan stream details + operationId: get_stream_detail_v1_report_dynamic_stream__stream_id__get + parameters: + - + name: stream_id + in: path + required: true + schema: type: string format: uuid - title: Target Id - description: Target UUID - output: - type: string - title: Output - description: Attack output content - threat: - anyOf: - - type: boolean - - type: 'null' - title: Threat - description: Threat detection result - marked_safe: - anyOf: - - type: boolean - - type: 'null' - title: Marked Safe - description: Manual safety marking - type: object - required: - - uuid - - tsg_id - - custom_attack_id - - job_id - - target_id - - output - title: CustomAttackOutputSchema - description: Schema for custom attack output response. - CustomAttackReportResponse: - properties: - total_prompts: - type: integer - title: Total Prompts - description: Total number of unique prompts - total_attacks: - type: integer - title: Total Attacks - description: Total number of attacks executed - total_threats: - type: integer - title: Total Threats - description: Number of threats detected - failed_attacks: - type: integer - title: Failed Attacks - description: Number of failed attacks (no threats detected) - score: - type: number - title: Score - description: Overall threat score (0-100) - asr: - type: number - title: Asr - description: Attack Success Rate (0-100) - custom_attack_reports: - items: - $ref: '#/components/schemas/PromptSetSummary' - type: array - title: Custom Attack Reports - description: Reports for each prompt set - property_statistics: - items: - $ref: '#/components/schemas/PropertyStatistic' - type: array - title: Property Statistics - description: Aggregated property statistics - type: object - required: - - total_prompts - - total_attacks - - total_threats - - failed_attacks - - score - - asr - title: CustomAttackReportResponse - description: Main custom attack report response. - CustomAttacksListResponse: - properties: - pagination: - $ref: '#/components/schemas/PaginationSchema' - data: - items: - $ref: '#/components/schemas/PromptDetailResponse' - type: array - title: Data - description: List of attack details - total_attacks: - type: integer - title: Total Attacks - description: Total number of attacks - total_threats: - type: integer - title: Total Threats - description: Number of threats detected - type: object - required: - - pagination - - data - - total_attacks - - total_threats - title: CustomAttacksListResponse - description: Enhanced list response for custom attacks. - CustomJobMetadata: - properties: - rate_limit_enabled: - type: boolean - title: Rate Limit Enabled - default: false - rate_limit: - anyOf: - - type: integer - - type: 'null' - title: Rate Limit - rate_limit_error_code: - anyOf: - - type: integer - - type: 'null' - title: Rate Limit Error Code - rate_limit_error_message: - anyOf: - - type: string - - type: 'null' - title: Rate Limit Error Message - rate_limit_error_json: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Rate Limit Error Json - content_filter_enabled: - type: boolean - title: Content Filter Enabled - description: Enable content filtering - default: false - content_filter_error_code: - anyOf: - - type: integer - maximum: 599 - minimum: 400 - - type: 'null' - title: Content Filter Error Code - description: HTTP error code for content filter (400-599) - content_filter_error_message: - anyOf: - - type: string - - type: 'null' - title: Content Filter Error Message - description: Content filter error message - content_filter_error_json: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Content Filter Error Json - custom_prompt_sets: - items: - type: string - format: uuid - type: array - minItems: 1 - title: Custom Prompt Sets - description: List of custom prompt set UUIDs - type: object - required: - - custom_prompt_sets - title: CustomJobMetadata - description: Enhanced metadata for custom attack jobs. - CustomTopicGuardrailsSchema: - properties: - action: - $ref: '#/components/schemas/GuardrailAction' - description: 'Action to take: ''allow'', ''block''' - default: BLOCK - blocked_topics: - items: - type: string - type: array - title: Blocked Topics - description: List of blocked topics - type: object - title: CustomTopicGuardrailsSchema - description: Custom topic guardrails with blocked topics. - DateRangeFilter: - type: string - enum: - - LAST_7_DAYS - - LAST_15_DAYS - - LAST_30_DAYS - - ALL - title: DateRangeFilter - description: Predefined date range filters for chart APIs. - DynamicJobMetadata: - properties: - rate_limit_enabled: - type: boolean - title: Rate Limit Enabled - default: false - rate_limit: - anyOf: - - type: integer - - type: 'null' - title: Rate Limit - rate_limit_error_code: - anyOf: - - type: integer - - type: 'null' - title: Rate Limit Error Code - rate_limit_error_message: - anyOf: - - type: string - - type: 'null' - title: Rate Limit Error Message - rate_limit_error_json: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Rate Limit Error Json - content_filter_enabled: - type: boolean - title: Content Filter Enabled - description: Enable content filtering - default: false - content_filter_error_code: - anyOf: - - type: integer - maximum: 599 - minimum: 400 - - type: 'null' - title: Content Filter Error Code - description: HTTP error code for content filter (400-599) - content_filter_error_message: + title: Stream Id + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/StreamDetailResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + description: Get detailed stream information including iteration data for a specific stream. + /v1/report/{job_id}/download: + get: + tags: + - Report + summary: Download report + description: Download report files for a job. + operationId: download_report_v1_report__job_id__download_get + parameters: + - + name: job_id + in: path + required: true + schema: + type: string + format: uuid + title: Job Id + - + name: file_format + in: query + required: true + schema: + $ref: '#/components/schemas/FileFormat' + description: 'Format of the report file (CSV, JSON, or ALL)' + description: 'Format of the report file (CSV, JSON, or ALL)' + responses: + 200: + description: Successful Response + content: + application/json: + schema: {} + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/report/{job_id}/generate-partial-report: + post: + tags: + - Report + summary: Generate partial scan report + description: 'Unlock a partial report by consuming a quota credit. This endpoint: - Validates the job is PARTIALLY_COMPLETE - Consumes 1 quota credit of the job type - Unlocks the report for viewing **Returns:** - Updated job information with unlocked report' + operationId: generate_partial_job_report_v1_report__job_id__generate_partial_report_post + parameters: + - + name: job_id + in: path + required: true + schema: + type: string + format: uuid + title: Job Id + responses: + 200: + description: Successful Response + content: + application/json: + schema: {} + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/report/static/{job_id}/attack-multi-turn/{attack_id}: + get: + tags: + - Report + summary: Get multi-turn attack details + description: Get detailed multi-turn attack information including outputs and framework techniques. + operationId: get_attack_multi_turn_detail_v1_report_static__job_id__attack_multi_turn__attack_id__get + parameters: + - + name: job_id + in: path + required: true + schema: + type: string + format: uuid + title: Job Id + - + name: attack_id + in: path + required: true + schema: + type: string + format: uuid + title: Attack Id + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AttackMultiTurnDetailResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/metering/quota: + post: + tags: + - Quota + summary: Get quota summary + description: Get aggregated quota summary for the current TSG (POST endpoint for backward compatibility). + operationId: post_quota_summary_v1_metering_quota_post + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/QuotaSummarySchema' + 401: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attacks/report/{job_id}: + get: + tags: + - CustomAttack + summary: Get custom attack Report + description: Get comprehensive custom attack report. + operationId: get_custom_attack_report_v1_custom_attacks_report__job_id__get + parameters: + - + name: job_id + in: path + required: true + schema: + type: string + format: uuid + title: Job Id + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomAttackReportResponse' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attacks/report/{job_id}/prompt-sets: + get: + tags: + - CustomAttack + summary: Get prompt sets + description: Get prompt sets with filtering and pagination. + operationId: get_prompt_sets_v1_custom_attacks_report__job_id__prompt_sets_get + parameters: + - + name: job_id + in: path + required: true + schema: + type: string + format: uuid + title: Job Id + - + name: property_filters + in: query + required: false + schema: anyOf: - type: string - type: 'null' - title: Content Filter Error Message - description: Content filter error message - content_filter_error_json: + description: JSON string of property filters + title: Property Filters + description: JSON string of property filters + - + name: is_threat + in: query + required: false + schema: anyOf: - - additionalProperties: true - type: object + - type: boolean - type: 'null' - title: Content Filter Error Json - stream_breadth: - type: integer - maximum: 20 - minimum: 1 - title: Stream Breadth - description: Number of parallel attack streams (1-20) - default: 6 - stream_depth: - type: integer - maximum: 20 - minimum: 1 - title: Stream Depth - description: Depth of each attack stream (1-20) - default: 10 - max_tokens: + description: Filter by threat status + title: Is Threat + description: Filter by threat status + - + name: skip + in: query + required: false + schema: type: integer - maximum: 4096 - minimum: 128 - title: Max Tokens - description: Maximum tokens per response (128-4096) - default: 256 - context_size: + minimum: 0 + description: Number of records to skip + default: 0 + title: Skip + description: Number of records to skip + - + name: limit + in: query + required: false + schema: type: integer - maximum: 20 + maximum: 100 minimum: 1 - title: Context Size - description: Context window size (1-20) - default: 10 - attack_goals: - items: - type: string - type: array - title: Attack Goals - description: List of attack objectives - base_model: - anyOf: - - type: string - - type: 'null' - title: Base Model - description: Base model identifier - use_case: - anyOf: - - type: string - - type: 'null' - title: Use Case - description: Attack use case description - system_prompt: + description: Maximum number of records to return + default: 20 + title: Limit + description: Maximum number of records to return + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/PromptSetsReportResponse' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attacks/report/{job_id}/prompt-set/{prompt_set_id}/prompts: + get: + tags: + - CustomAttack + summary: Get prompts by set + description: Get prompts for a specific prompt set with pagination. + operationId: get_prompts_by_set_v1_custom_attacks_report__job_id__prompt_set__prompt_set_id__prompts_get + parameters: + - + name: job_id + in: path + required: true + schema: + type: string + format: uuid + title: Job Id + - + name: prompt_set_id + in: path + required: true + schema: + type: string + format: uuid + title: Prompt Set Id + - + name: is_threat + in: query + required: false + schema: anyOf: - - type: string + - type: boolean - type: 'null' - title: System Prompt - description: Custom system prompt - type: object - title: DynamicJobMetadata - description: Enhanced metadata for dynamic attack jobs with proper constraints. - DynamicJobReportSchema: - properties: - total_goals: + description: Filter by threat status + title: Is Threat + description: Filter by threat status + - + name: skip + in: query + required: false + schema: type: integer minimum: 0 - title: Total Goals - description: Total number of goals tested + description: Number of records to skip default: 0 - total_streams: + title: Skip + description: Number of records to skip + - + name: limit + in: query + required: false + schema: type: integer - minimum: 0 - title: Total Streams - description: Total number of attack streams - default: 0 - total_threats: + maximum: 100 + minimum: 1 + description: Maximum number of records to return + default: 20 + title: Limit + description: Maximum number of records to return + responses: + 200: + description: Successful Response + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PromptDetailResponse' + title: Response Get Prompts By Set V1 Custom Attacks Report Job Id Prompt Set Prompt Set Id Prompts Get + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attacks/report/{job_id}/prompt/{prompt_id}: + get: + tags: + - CustomAttack + summary: Get prompt detail + description: Get detailed information for a specific prompt. + operationId: get_prompt_detail_v1_custom_attacks_report__job_id__prompt__prompt_id__get + parameters: + - + name: job_id + in: path + required: true + schema: + type: string + format: uuid + title: Job Id + - + name: prompt_id + in: path + required: true + schema: + type: string + format: uuid + title: Prompt Id + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/PromptDetailResponse' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attacks/job/{job_id}/list-custom-attacks: + get: + tags: + - CustomAttack + summary: List custom attacks + description: List custom attacks with V2 features. + operationId: list_custom_attacks_v1_custom_attacks_job__job_id__list_custom_attacks_get + parameters: + - + name: job_id + in: path + required: true + schema: + type: string + format: uuid + title: Job Id + - + name: skip + in: query + required: false + schema: type: integer minimum: 0 - title: Total Threats - description: Total number of threats detected + description: Number of records to skip default: 0 - goals_achieved: + title: Skip + description: Number of records to skip + - + name: limit + in: query + required: false + schema: type: integer - minimum: 0 - title: Goals Achieved - description: Number of goals with at least one threat - default: 0 - report_summary: + maximum: 1000 + minimum: 1 + description: Maximum number of records to return + default: 100 + title: Limit + description: Maximum number of records to return + - + name: threat + in: query + required: false + schema: + anyOf: + - type: boolean + - type: 'null' + description: '[Deprecated: use status] Filter by threat status' + title: Threat + description: '[Deprecated: use status] Filter by threat status' + - + name: prompt_set_id + in: query + required: false + schema: anyOf: - type: string - type: 'null' - title: Report Summary - description: LLM-generated executive summary for the dynamic job - score: - type: number - maximum: 100 - minimum: 0 - title: Score - description: Overall security score (0-100) - default: 0 - asr: - type: number - maximum: 100 - minimum: 0 - title: Asr - description: Attack Success Rate (0-100) - default: 0 - type: object - title: DynamicJobReportSchema - description: Core metrics for report generation. - DynamicJobReportStats: - properties: - total_goals: - type: integer - minimum: 0 - title: Total Goals - description: Total number of goals tested - default: 0 - total_streams: + description: Filter by prompt set ID + title: Prompt Set Id + description: Filter by prompt set ID + - + name: property_value + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: JSON string of property filters + title: Property Value + description: JSON string of property filters + - + name: status + in: query + required: false + schema: + anyOf: + - $ref: '#/components/schemas/StatusQueryParam' + - type: 'null' + description: 'Filter by status: SUCCESSFUL, FAILED, ERROR' + title: Status + description: 'Filter by status: SUCCESSFUL, FAILED, ERROR' + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomAttacksListResponse' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attacks/job/{job_id}/attack/{attack_id}/list-outputs: + get: + tags: + - CustomAttack + summary: Get attack outputs + description: Get outputs for a specific attack. + operationId: get_attack_outputs_v1_custom_attacks_job__job_id__attack__attack_id__list_outputs_get + parameters: + - + name: job_id + in: path + required: true + schema: + type: string + format: uuid + title: Job Id + - + name: attack_id + in: path + required: true + schema: + type: string + format: uuid + title: Attack Id + responses: + 200: + description: Successful Response + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CustomAttackOutputResponseSchema' + title: Response Get Attack Outputs V1 Custom Attacks Job Job Id Attack Attack Id List Outputs Get + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attacks/job/{job_id}/property-stats: + get: + tags: + - CustomAttack + summary: Get property stats + description: Get property-based statistics for custom attacks. + operationId: get_property_stats_v1_custom_attacks_job__job_id__property_stats_get + parameters: + - + name: job_id + in: path + required: true + schema: + type: string + format: uuid + title: Job Id + responses: + 200: + description: Successful Response + content: + application/json: + schema: + type: array + items: + type: object + additionalProperties: true + title: Response Get Property Stats V1 Custom Attacks Job Job Id Property Stats Get + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/error-log/job/{job_id}: + get: + tags: + - ErrorLogs + summary: List error logs for a scan + description: List error logs for a specific job + operationId: list_error_logs_for_job_v1_error_log_job__job_id__get + parameters: + - + name: job_id + in: path + required: true + schema: + type: string + format: uuid + title: Job Id + - + name: limit + in: query + required: false + schema: type: integer - minimum: 0 - title: Total Streams - description: Total number of attack streams - default: 0 - total_threats: + maximum: 100 + minimum: 1 + description: Number of attacks to return (1-100) + default: 5 + title: Limit + description: Number of attacks to return (1-100) + - + name: skip + in: query + required: false + schema: type: integer minimum: 0 - title: Total Threats - description: Total number of threats detected + description: Number of attacks to skip for pagination default: 0 - goals_achieved: + title: Skip + description: Number of attacks to skip for pagination + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorLogListResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/error-log/target-profile/{target_id}: + get: + tags: + - ErrorLogs + summary: List profiling errors for a target + description: List deduplicated profiling error logs for a target's latest profiling run. + operationId: list_error_logs_for_target_profile_v1_error_log_target_profile__target_id__get + parameters: + - + name: target_id + in: path + required: true + schema: + type: string + format: uuid + title: Target Id + - + name: limit + in: query + required: false + schema: type: integer - minimum: 0 - title: Goals Achieved - description: Number of goals with at least one threat - default: 0 - report_summary: + maximum: 100 + minimum: 1 + description: Number of errors to return (1-100) + default: 5 + title: Limit + description: Number of errors to return (1-100) + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorLogListResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/languages: + get: + tags: + - Languages + summary: Get available languages for scan + description: Return allowed languages for the requesting tenant's scan page. + operationId: get_languages_v1_languages_get + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/TenantLanguagesResponseSchema' + 401: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/dashboard/scan-statistics: + get: + tags: + - Dashboard + summary: Get scan statistics and risk profile + description: 'Returns scan counts, target statistics, status breakdown, and risk profile for dashboard display.' + operationId: get_scan_statistics_v1_dashboard_scan_statistics_get + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/ScanStatisticsResponseSchema' + 401: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/dashboard/score-trend: + get: + tags: + - Dashboard + summary: Get score trend for a target + description: Returns time-series risk scores grouped by job type for chart display. + operationId: get_score_trend_v1_dashboard_score_trend_get + parameters: + - + name: target_id + in: query + required: true + schema: + type: string + format: uuid + description: Target UUID to fetch scores for + title: Target Id + description: Target UUID to fetch scores for + - + name: date_range + in: query + required: false + schema: + $ref: '#/components/schemas/DateRangeFilter' + description: Predefined date range filter + default: LAST_7_DAYS + description: Predefined date range filter + - + name: start_date + in: query + required: false + schema: anyOf: - - type: string + - + type: string + format: date - type: 'null' - title: Report Summary - description: LLM-generated executive summary for the dynamic job - type: object - title: DynamicJobReportStats - ErrorLogListResponseSchema: - properties: - pagination: - $ref: '#/components/schemas/PaginationSchema' - data: - items: - $ref: '#/components/schemas/ErrorLogListSchema' - type: array - title: Data - description: List of error logs - type: object - required: - - pagination - - data - title: ErrorLogListResponseSchema - description: Schema for error log list response. - ErrorLogListSchema: + description: Custom start date (overrides date_range if both provided) + title: Start Date + description: Custom start date (overrides date_range if both provided) + - + name: end_date + in: query + required: false + schema: + anyOf: + - + type: string + format: date + - type: 'null' + description: Custom end date (overrides date_range if both provided) + title: End Date + description: Custom end date (overrides date_range if both provided) + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/ScoreTrendResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/sentiment: + post: + tags: + - Sentiment + summary: Update sentiment scan report + description: Create or update sentiment for a job report. + operationId: create_or_update_sentiment_v1_sentiment_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SentimentRequestSchema' + required: true + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/SentimentResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/sentiment/{job_id}: + get: + tags: + - Sentiment + summary: Get sentiment for a scan + description: Get Sentiment status of a scan. + operationId: get_job_sentiment_v1_sentiment__job_id__get + parameters: + - + name: job_id + in: path + required: true + schema: + type: string + format: uuid + title: Job Id + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/SentimentResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT + schemas: + ApiEndpointType: + type: string + enum: + - PUBLIC + - PRIVATE + - NETWORK_BROKER + title: ApiEndpointType + description: API endpoint accessibility type. + AttackDetailResponseSchema: properties: + uuid: + type: string + format: uuid + title: Uuid + tsg_id: + type: string + title: Tsg Id job_id: - anyOf: - - type: string - format: uuid - - type: 'null' + type: string + format: uuid title: Job Id - description: UUID of the job associated with this error + description: Associated job UUID target_id: - anyOf: - - type: string - format: uuid - - type: 'null' + type: string + format: uuid title: Target Id - description: UUID of the target associated with this error - target_version: - anyOf: - - type: integer - - type: 'null' - title: Target Version - description: Version of the target configuration when error occurred - attack_id: + description: Target UUID + prompt: + type: string + title: Prompt + description: The actual prompt text used + status: + $ref: '#/components/schemas/AttackStatus' + description: Attack status + default: INIT + marked_safe: anyOf: - - type: string - format: uuid + - type: boolean - type: 'null' - title: Attack Id - description: UUID of the attack attempt that caused the error - error_type: + title: Marked Safe + description: Manual safety marking + extra_info: + additionalProperties: true + type: object + title: Extra Info + description: Additional metadata + threat: anyOf: - - $ref: '#/components/schemas/ErrorType' + - type: boolean - type: 'null' - description: Type/category of the error - error_source: + title: Threat + description: Threat detection result + attack_type: + $ref: '#/components/schemas/AttackType' + description: Type of attack + default: NORMAL + multi_turn: + type: boolean + title: Multi Turn + description: Multi-turn conversation flag + default: false + asr: anyOf: - - $ref: '#/components/schemas/ErrorSource' + - + type: number + maximum: 100.0 + minimum: 0.0 - type: 'null' - description: Source/origin of the error - error_message: + title: Asr + description: Attack Success Rate (0-100) + version: anyOf: - - type: string + - type: integer - type: 'null' - title: Error Message - description: Human-readable error message - target_object: + title: Version + description: Attack version + error: anyOf: - - additionalProperties: true - type: object + - type: boolean - type: 'null' - title: Target Object - description: Snapshot of target configuration at error time - extra_info: + title: Error + description: True if all attack attempts failed (zero outputs produced) + prompt_mapping_id: + type: string + format: uuid + title: Prompt Mapping Id + description: Prompt mapping UUID + prompt_id: + type: string + format: uuid + title: Prompt Id + description: Prompt UUID + category: + $ref: '#/components/schemas/Category' + description: Attack category + sub_category: anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Extra Info - description: Any additional context or metadata - version: - type: integer - title: Version - description: Schema version for future evolution - default: 1 - created_at: + - $ref: '#/components/schemas/SecuritySubCategory' + - $ref: '#/components/schemas/SafetySubCategory' + - $ref: '#/components/schemas/BrandSubCategory' + - $ref: '#/components/schemas/ComplianceSubCategory' + title: Sub Category + description: Attack subcategory + severity: type: string - format: date-time - title: Created At - description: When the error log was created - updated_at: + description: Attack severity level + category_display_name: type: string - format: date-time - title: Updated At - description: When the error log was last updated + title: Category Display Name + sub_category_display_name: + type: string + title: Sub Category Display Name + compliance_frameworks: + items: + $ref: '#/components/schemas/ComplianceWithTechniqueModel' + type: array + title: Compliance Frameworks + outputs: + items: + $ref: '#/components/schemas/AttackOutputResponseSchema' + type: array + title: Outputs + description: Outputs for attacks + goal: + anyOf: + - type: string + - type: 'null' + title: Goal type: object required: - - created_at - - updated_at - title: ErrorLogListSchema - ErrorSource: - type: string - enum: - - TARGET - - JOB - - SYSTEM - - VALIDATION - - TARGET_PROFILING - title: ErrorSource - description: Source/origin of the error. - ErrorType: - type: string - enum: - - CONTENT_FILTER - - RATE_LIMIT - - AUTHENTICATION - - NETWORK - - VALIDATION - - NETWORK_CHANNEL - - UNKNOWN - title: ErrorType - description: Classification of error types. - FileFormat: - type: string - enum: - - CSV - - JSON - - ALL - title: FileFormat - description: File format options for report downloads. - GoalListResponseSchema: + - uuid + - tsg_id + - job_id + - target_id + - prompt + - prompt_mapping_id + - prompt_id + - category + - sub_category + - category_display_name + - sub_category_display_name + - compliance_frameworks + - goal + title: AttackDetailResponseSchema + AttackListResponseSchema: properties: pagination: $ref: '#/components/schemas/PaginationSchema' data: items: - $ref: '#/components/schemas/GoalSchema' + $ref: '#/components/schemas/AttackListSchema' type: array title: Data - description: List of Goals + description: List of Attacks type: object required: - pagination - data - title: GoalListResponseSchema - description: Response schema for listing attacks following common pagination - pattern. - GoalSchema: + title: AttackListResponseSchema + description: Response schema for listing attacks following common pagination pattern. + AttackListSchema: properties: - goal: - type: string - title: Goal - description: The test goal/prompt - safe_response: - type: string - title: Safe Response - description: The complete safe response with proper refusal - jailbroken_response: - type: string - minLength: 1 - title: Jailbroken Response - description: The complete jailbroken response without disclaimers - goal_metadata: - additionalProperties: true - type: object - title: Goal Metadata - description: Additional metadata - custom_goal: - type: boolean - title: Custom Goal - description: Indicates if it is a custom goal - default: false - goal_type: - $ref: '#/components/schemas/GoalType' - description: 'Goal type: BASE, TOOL_MISUSE, GOAL_MANIPULATION' - default: BASE uuid: type: string format: uuid @@ -1433,145 +1711,250 @@ components: type: string format: uuid title: Job Id - description: Job identifier - goal_to_show: + description: Associated job UUID + target_id: + type: string + format: uuid + title: Target Id + description: Target UUID + prompt: + type: string + title: Prompt + description: The actual prompt text used + status: + $ref: '#/components/schemas/AttackStatus' + description: Attack status + default: INIT + marked_safe: + anyOf: + - type: boolean + - type: 'null' + title: Marked Safe + description: Manual safety marking + extra_info: + additionalProperties: true + type: object + title: Extra Info + description: Additional metadata + threat: anyOf: - - type: string + - type: boolean - type: 'null' - title: Goal To Show - description: Goal to use in the backend - threat: - type: boolean title: Threat - description: Indicates if it is a threat + description: Threat detection result + attack_type: + $ref: '#/components/schemas/AttackType' + description: Type of attack + default: NORMAL + multi_turn: + type: boolean + title: Multi Turn + description: Multi-turn conversation flag default: false + asr: + anyOf: + - + type: number + maximum: 100.0 + minimum: 0.0 + - type: 'null' + title: Asr + description: Attack Success Rate (0-100) version: anyOf: - type: integer - type: 'null' title: Version - description: Goal schema version - extra_info: + description: Attack version + error: anyOf: - - additionalProperties: true - type: object + - type: boolean - type: 'null' - title: Extra Info - description: Extra info + title: Error + description: True if all attack attempts failed (zero outputs produced) + prompt_mapping_id: + type: string + format: uuid + title: Prompt Mapping Id + description: Prompt mapping UUID + prompt_id: + type: string + format: uuid + title: Prompt Id + description: Prompt UUID + category: + $ref: '#/components/schemas/Category' + description: Attack category + sub_category: + anyOf: + - $ref: '#/components/schemas/SecuritySubCategory' + - $ref: '#/components/schemas/SafetySubCategory' + - $ref: '#/components/schemas/BrandSubCategory' + - $ref: '#/components/schemas/ComplianceSubCategory' + title: Sub Category + description: Attack subcategory + severity: + type: string + description: Attack severity level + category_display_name: + type: string + title: Category Display Name + sub_category_display_name: + type: string + title: Sub Category Display Name type: object required: - - goal - - safe_response - - jailbroken_response - uuid - tsg_id - job_id - title: GoalSchema - GoalType: - type: string - enum: - - BASE - - TOOL_MISUSE - - GOAL_MANIPULATION - title: GoalType - GoalTypeQueryParam: - type: string - enum: - - AGENT - - HUMAN_AUGMENTED - title: GoalTypeQueryParam - GuardrailAction: - type: string - enum: - - ALLOW - - BLOCK - title: GuardrailAction - description: Actions that can be taken by guardrails. - HTTPValidationError: - properties: - detail: - items: - $ref: '#/components/schemas/ValidationError' - type: array - title: Detail - type: object - title: HTTPValidationError - JobAbortResponseSchema: + - target_id + - prompt + - prompt_mapping_id + - prompt_id + - category + - sub_category + - category_display_name + - sub_category_display_name + title: AttackListSchema + AttackMultiTurnDetailResponseSchema: properties: + uuid: + type: string + format: uuid + title: Uuid + tsg_id: + type: string + title: Tsg Id job_id: type: string format: uuid title: Job Id - description: UUID of the aborted job - message: + description: Associated job UUID + target_id: type: string - title: Message - description: Status message - type: object - required: - - job_id - - message - title: JobAbortResponseSchema - description: Response schema for job abort operation. - JobCreateRequestSchema: - properties: - name: + format: uuid + title: Target Id + description: Target UUID + prompt: type: string - maxLength: 255 - minLength: 3 - title: Name - description: Job name (3-255 characters) - target: - $ref: '#/components/schemas/TargetJobRequest' - description: Target reference for job creation - job_type: - $ref: '#/components/schemas/JobType' - description: Type of job to execute - job_metadata: + title: Prompt + description: The actual prompt text used + status: + $ref: '#/components/schemas/AttackStatus' + description: Attack status + default: INIT + marked_safe: anyOf: - - $ref: '#/components/schemas/StaticJobMetadata' - - $ref: '#/components/schemas/DynamicJobMetadata' - - $ref: '#/components/schemas/CustomJobMetadata' - title: Job Metadata - description: Job-specific metadata + - type: boolean + - type: 'null' + title: Marked Safe + description: Manual safety marking + extra_info: + additionalProperties: true + type: object + title: Extra Info + description: Additional metadata + threat: + anyOf: + - type: boolean + - type: 'null' + title: Threat + description: Threat detection result + attack_type: + $ref: '#/components/schemas/AttackType' + description: Type of attack + default: NORMAL + multi_turn: + type: boolean + title: Multi Turn + description: Multi-turn conversation flag + default: false + asr: + anyOf: + - + type: number + maximum: 100.0 + minimum: 0.0 + - type: 'null' + title: Asr + description: Attack Success Rate (0-100) version: anyOf: - type: integer - type: 'null' title: Version - description: Job version - extra_info: + description: Attack version + error: anyOf: - - additionalProperties: true - type: object + - type: boolean - type: 'null' - title: Extra Info - additionalProperties: false - type: object - required: - - name - - target - - job_type - - job_metadata - title: JobCreateRequestSchema - description: Request schema for creating jobs. - JobListResponseSchema: - properties: - pagination: - $ref: '#/components/schemas/PaginationSchema' - data: + title: Error + description: True if all attack attempts failed (zero outputs produced) + prompt_mapping_id: + type: string + format: uuid + title: Prompt Mapping Id + description: Prompt mapping UUID + prompt_id: + type: string + format: uuid + title: Prompt Id + description: Prompt UUID + category: + $ref: '#/components/schemas/Category' + description: Attack category + sub_category: + anyOf: + - $ref: '#/components/schemas/SecuritySubCategory' + - $ref: '#/components/schemas/SafetySubCategory' + - $ref: '#/components/schemas/BrandSubCategory' + - $ref: '#/components/schemas/ComplianceSubCategory' + title: Sub Category + description: Attack subcategory + severity: + type: string + description: Attack severity level + category_display_name: + type: string + title: Category Display Name + sub_category_display_name: + type: string + title: Sub Category Display Name + compliance_frameworks: items: - $ref: '#/components/schemas/JobResponseSchema' + $ref: '#/components/schemas/ComplianceWithTechniqueModel' type: array - title: Data - description: List of jobs + title: Compliance Frameworks + outputs: + items: + items: + $ref: '#/components/schemas/AttackMultiTurnOutputResponseSchema' + type: array + type: array + title: Outputs + description: 'List of conversations, where each conversation is a list of turns ordered by turn number. Each inner list represents one generation of the multi-turn attack.' + goal: + anyOf: + - type: string + - type: 'null' + title: Goal type: object required: - - pagination - - data - title: JobListResponseSchema - description: Response schema for listing jobs following common pagination pattern. - JobResponseSchema: + - uuid + - tsg_id + - job_id + - target_id + - prompt + - prompt_mapping_id + - prompt_id + - category + - sub_category + - category_display_name + - sub_category_display_name + - compliance_frameworks + - goal + title: AttackMultiTurnDetailResponseSchema + AttackMultiTurnOutputResponseSchema: properties: uuid: type: string @@ -1580,372 +1963,551 @@ components: tsg_id: type: string title: Tsg Id - name: + attack_id: type: string - maxLength: 255 - minLength: 3 - title: Name - description: Job name (3-255 characters) - target: - $ref: '#/components/schemas/TargetReferenceSchema' - description: Full target configuration - job_type: - $ref: '#/components/schemas/JobType' - description: Type of job to execute - job_metadata: - anyOf: - - $ref: '#/components/schemas/StaticJobMetadata' - - $ref: '#/components/schemas/DynamicJobMetadata' - - $ref: '#/components/schemas/CustomJobMetadata' - title: Job Metadata - description: Job-specific metadata - version: - anyOf: - - type: integer - - type: 'null' - title: Version - description: Job version - extra_info: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Extra Info + format: uuid + title: Attack Id + description: Associated attack UUID + job_id: + type: string + format: uuid + title: Job Id + description: Associated job UUID target_id: type: string format: uuid title: Target Id - description: Target UUID (denormalized) - target_type: + description: Target UUID + output: type: string - title: Target Type - description: Target type (APPLICATION, AGENT, MODEL) - total: - anyOf: - - type: integer - minimum: 0 - - type: 'null' - title: Total - description: Total tasks in job - completed: - anyOf: - - type: integer - minimum: 0 - - type: 'null' - title: Completed - description: Completed tasks - status: - $ref: '#/components/schemas/JobStatus' - description: Current job status - default: INIT - score: - anyOf: - - type: number - maximum: 100 - minimum: 0 - - type: 'null' - title: Score - description: Overall job performance score (0-100) - asr: + title: Output + description: 'Attack output. String for single-turn, dict for multi-turn.' + threat: anyOf: - - type: number - maximum: 100 - minimum: 0 + - type: boolean - type: 'null' - title: Asr - description: Updated Attack Success Rate (0-100) - time_record: + title: Threat + description: Threat detection result + marked_safe: anyOf: - - $ref: '#/components/schemas/JobTimeRecord' + - type: boolean - type: 'null' - description: Job timing information - created_at: + title: Marked Safe + description: Manual safety marking + prompt: + type: string + title: Prompt + description: User prompt for this turn + turn: + type: integer + title: Turn + description: Current turn number in multi-turn conversation + generation: + type: integer + title: Generation + description: Generation/conversation number (1-based) for grouping multi-turn outputs + default: 1 + multi_turn: + type: boolean + title: Multi Turn + description: Multi-turn conversation flag + default: true + error: anyOf: - - type: string - format: date-time + - type: boolean - type: 'null' - title: Created At - description: Creation timestamp - updated_at: + title: Error + description: Whether this output is an error + error_message: anyOf: - type: string - format: date-time - type: 'null' - title: Updated At - description: Last update timestamp - created_by_user_id: + title: Error Message + description: 'Error message in format ''errType: description''' + type: object + required: + - uuid + - tsg_id + - attack_id + - job_id + - target_id + - output + - prompt + - turn + title: AttackMultiTurnOutputResponseSchema + description: API response schema — excludes internal/debug fields from client responses. + AttackOutputResponseSchema: + properties: + uuid: + type: string + format: uuid + title: Uuid + tsg_id: + type: string + title: Tsg Id + attack_id: + type: string + format: uuid + title: Attack Id + description: Associated attack UUID + job_id: + type: string + format: uuid + title: Job Id + description: Associated job UUID + target_id: + type: string + format: uuid + title: Target Id + description: Target UUID + output: + type: string + title: Output + description: 'Attack output. String for single-turn, dict for multi-turn.' + threat: anyOf: - - type: string - format: uuid + - type: boolean - type: 'null' - title: Created By User Id - description: UUID of the user creating this job - report_stats: + title: Threat + description: Threat detection result + marked_safe: anyOf: - - $ref: '#/components/schemas/StaticJobReportStats' - - $ref: '#/components/schemas/DynamicJobReportStats' - - additionalProperties: true - type: object + - type: boolean - type: 'null' - title: Report Stats - description: Report statistics (StaticJobReportStats for STATIC/CUSTOM jobs, - DynamicJobReportStats for DYNAMIC jobs) - metering_quota_uuid: + title: Marked Safe + description: Manual safety marking + error: anyOf: - - type: string - format: uuid + - type: boolean - type: 'null' - title: Metering Quota Uuid - description: UUID of the metering quota used for this job - counted_towards_quota: - $ref: '#/components/schemas/CountedQuotaEnum' - description: Whether this job is counted towards quota consumption - default: HELD - invocation_id: + title: Error + description: Whether this output is an error + error_message: anyOf: - type: string - type: 'null' - title: Invocation Id - description: Restate invocationId of this job + title: Error Message + description: 'Error message in format ''errType: description''' type: object required: - uuid - tsg_id - - name - - target - - job_type - - job_metadata + - attack_id + - job_id - target_id - - target_type - title: JobResponseSchema - description: Job response schema. ONLY to be used in API response. - JobStatus: + - output + title: AttackOutputResponseSchema + description: API response schema — excludes internal/debug fields from client responses. + AttackStatus: type: string enum: - INIT - - QUEUED - - RUNNING + - ATTACK + - DETECTION + - REPORT - COMPLETED - - PARTIALLY_COMPLETE - FAILED - - ABORTED - title: JobStatus - description: Complete job status enum including internal INIT status. - JobStatusFilter: + title: AttackStatus + AttackType: type: string enum: - - QUEUED - - RUNNING - - COMPLETED - - PARTIALLY_COMPLETE - - FAILED - - ABORTED - title: JobStatusFilter - description: Job status enum for API filtering - excludes INIT from public API. - JobTimeRecord: - properties: - queued_at: - anyOf: - - type: string - format: date-time - - type: 'null' - title: Queued At - description: Job queue timestamp - started_at: - anyOf: - - type: string - format: date-time - - type: 'null' - title: Started At - description: Job start timestamp - completed_at: - anyOf: - - type: string - format: date-time - - type: 'null' - title: Completed At - description: Job completion timestamp - time_taken: - anyOf: - - type: string - format: duration - - type: 'null' - title: Time Taken - description: Total execution time - type: object - title: JobTimeRecord - description: Enhanced time tracking with validation. - JobType: + - NORMAL + - CUSTOM + title: AttackType + AuthType: type: string enum: - - STATIC - - DYNAMIC - - CUSTOM - title: JobType - description: Type of job execution. - MaliciousCodeDetectionSchema: + - HEADERS + - BASIC_AUTH + - OAUTH2 + title: AuthType + description: Authentication method for target API access. + BrandSubCategory: + type: string + enum: + - COMPETITOR_ENDORSEMENTS + - BRAND_TARNISHING_SELF_CRITICISM + - DISCRIMINATING_CLAIMS + - POLITICAL_ENDORSEMENTS + title: BrandSubCategory + Category: + type: string + enum: + - SECURITY + - SAFETY + - COMPLIANCE + - BRAND + title: Category + CategoryModel: properties: - action: - $ref: '#/components/schemas/GuardrailAction' - description: 'Action to take: ''allow'', ''block''' - default: BLOCK + id: + type: string + title: Id + description: Unique identifier + display_name: + type: string + title: Display Name + description: Frontend display name + description: + type: string + title: Description + description: Description + preselect: + type: boolean + title: Preselect + description: Whether this category should be preselected in UI + default: true + sub_categories: + items: + $ref: '#/components/schemas/SubCategoryModel' + type: array + title: Sub Categories + description: List of subcategories type: object - title: MaliciousCodeDetectionSchema - description: Guardrail configuration for malicious code detection. - MaliciousURLDetectionSchema: + required: + - id + - display_name + - description + - sub_categories + title: CategoryModel + description: Pydantic model for category data + CategoryReportSchema: properties: - action: - $ref: '#/components/schemas/GuardrailAction' - description: 'Action to take: ''allow'', ''block''' - default: BLOCK + id: + type: string + title: Id + description: Unique identifier + display_name: + type: string + title: Display Name + description: Frontend display name + description: + type: string + title: Description + description: Description + preselect: + type: boolean + title: Preselect + description: Whether this category should be preselected in UI + default: true + sub_categories: + items: + $ref: '#/components/schemas/SubCategoryStatsSchema' + type: array + title: Sub Categories + description: 'Statistics per subcategory (e.g., ADVERSARIAL_SUFFIX, BIAS)' + asr: + type: number + maximum: 100.0 + minimum: 0.0 + title: Asr + description: Attack success rate percentage + total_prompts: + type: integer + title: Total Prompts + description: Total unique prompts used + total_attacks: + type: integer + title: Total Attacks + description: Total attacks executed + successful: + type: integer + title: Successful + description: Total successful attacks + failed: + type: integer + title: Failed + description: Total failed attacks type: object - title: MaliciousURLDetectionSchema - description: Guardrail configuration for malicious URL detection. - PaginationSchema: + required: + - id + - display_name + - description + - sub_categories + - asr + - total_prompts + - total_attacks + - successful + - failed + title: CategoryReportSchema + description: Security or Safety risk overview widget data. + ClaraJobMetadata: properties: - total_items: - anyOf: - - type: integer - - type: 'null' - title: Total Items + scan_name: + type: string + maxLength: 255 + minLength: 3 + title: Scan Name + categories: + additionalProperties: + items: + anyOf: + - $ref: '#/components/schemas/SecuritySubCategory' + - $ref: '#/components/schemas/SafetySubCategory' + - $ref: '#/components/schemas/BrandSubCategory' + - $ref: '#/components/schemas/ComplianceSubCategory' + type: array + propertyNames: + $ref: '#/components/schemas/Category' + type: object + title: Categories + description: Auto-derived from uploaded prompt data — determines report sections + language: + type: 'null' + title: Language + description: Always None — CLARA is English-only type: object - title: PaginationSchema - PolicyType: + required: + - scan_name + title: ClaraJobMetadata + description: | + Metadata for CLARA scan jobs. Intentionally minimal — + no rate_limit/content_filter since CLARA doesn't execute attacks. + ComplianceReportSchema: + properties: + id: + type: string + title: Id + description: Compliance framework unique identifier + display_name: + type: string + title: Display Name + description: Compliance framework display name for frontend + description: + type: string + title: Description + description: Compliance framework description + active: + type: boolean + title: Active + description: Whether compliance framework is active + version: + type: string + title: Version + description: Compliance framework version + link: + type: string + title: Link + description: Compliance framework documentation link + techniques: + items: + $ref: '#/components/schemas/ComplianceTechniqueSchema' + type: array + title: Techniques + score: + type: integer + title: Score + description: 'Compliance score: (1 - ASR%) % 5' + default: 0 + type: object + required: + - id + - display_name + - description + - active + - version + - link + - techniques + title: ComplianceReportSchema + ComplianceSubCategory: type: string enum: - - PROMPT_INJECTION - - TOXIC_CONTENT - - CUSTOM_TOPIC_GUARDRAILS - - MALICIOUS_CODE_DETECTION - - MALICIOUS_URL_DETECTION - - SENSITIVE_DATA_PROTECTION - title: PolicyType - description: Policy types with metadata. - PrerequisiteModel: + - OWASP + - MITRE_ATLAS + - NIST + - DASF_V2 + title: ComplianceSubCategory + ComplianceTechniqueSchema: + properties: + id: + type: string + title: Id + description: Technique unique identifier + display_name: + type: string + title: Display Name + description: Technique display name for frontend + compliance_id: + type: string + title: Compliance Id + description: Associated compliance framework ID + description: + type: string + title: Description + description: Technique description + link: + type: string + title: Link + description: Technique documentation link + version: + type: string + title: Version + description: Technique version + active: + type: boolean + title: Active + description: Whether technique is active + successful: + type: integer + title: Successful + description: Number of successful attacks + default: 0 + failed: + type: integer + title: Failed + description: Number of failed attacks + default: 0 + total: + type: integer + title: Total + description: Total attacks for this technique + default: 0 + type: object + required: + - id + - display_name + - compliance_id + - description + - link + - version + - active + title: ComplianceTechniqueSchema + description: Compliance Technique Model + ComplianceWithTechniqueModel: properties: id: type: string title: Id - description: Prerequisite unique identifier + description: Compliance framework unique identifier display_name: type: string title: Display Name - description: Prerequisite display name for frontend + description: Compliance framework display name for frontend description: type: string title: Description - description: Prerequisite description + description: Compliance framework description + active: + type: boolean + title: Active + description: Whether compliance framework is active + version: + type: string + title: Version + description: Compliance framework version + link: + type: string + title: Link + description: Compliance framework documentation link + techniques: + items: + $ref: '#/components/schemas/TechniqueModel' + type: array + title: Techniques + description: List of Techniques type: object required: - id - display_name - description - title: PrerequisiteModel - description: Pydantic model for prerequisite data - ProfilingStatus: + - active + - version + - link + - techniques + title: ComplianceWithTechniqueModel + CountByNameSchema: + properties: + name: + type: string + title: Name + description: 'Name of the item (e.g., target type, status)' + count: + type: integer + minimum: 0.0 + title: Count + description: Count of items + type: object + required: + - name + - count + title: CountByNameSchema + description: | + Generic count schema with name field for extensible list structures. + + Used in dashboard and other endpoints to provide counts grouped by a name field. + Frontend-friendly list format for easy iteration. + CountedQuotaEnum: type: string enum: - - INIT - - QUEUED - - IN_PROGRESS - - COMPLETED - - FAILED - title: ProfilingStatus - description: Status of target profiling workflow. - PromptDetailResponse: + - HELD + - COUNTED + - NOT_COUNTED + title: CountedQuotaEnum + description: Enum for counting Quota. + CustomAttackOutputResponseSchema: properties: - prompt_id: + uuid: type: string format: uuid - title: Prompt Id - description: Prompt UUID - prompt_text: + title: Uuid + tsg_id: type: string - title: Prompt Text - description: The prompt text - goal: - anyOf: - - type: string - - type: 'null' - title: Goal - description: Goal of the prompt - user_defined_goal: - type: boolean - title: User Defined Goal - description: Whether goal is user-defined - default: false - properties: - items: - $ref: '#/components/schemas/PropertyAssignment' - type: array - title: Properties - description: Property assignments - attack_id: - anyOf: - - type: string - format: uuid - - type: 'null' - title: Attack Id - description: Associated attack UUID + title: Tsg Id + custom_attack_id: + type: string + format: uuid + title: Custom Attack Id + description: Associated custom attack UUID + job_id: + type: string + format: uuid + title: Job Id + description: Associated job UUID + target_id: + type: string + format: uuid + title: Target Id + description: Target UUID + output: + type: string + title: Output + description: Attack output content threat: anyOf: - type: boolean - type: 'null' title: Threat - description: Whether threat was detected - attack_outputs: - items: - type: string - type: array - title: Attack Outputs - description: Attack output strings - asr: + description: Threat detection result + marked_safe: anyOf: - - type: number - maximum: 100 - minimum: 0 + - type: boolean - type: 'null' - title: Asr - description: Attack Success Rate for this prompt (0-100) - prompt_set_id: + title: Marked Safe + description: Manual safety marking + error: anyOf: - - type: string - format: uuid + - type: boolean - type: 'null' - title: Prompt Set Id - description: Prompt set UUID - prompt_set_name: + title: Error + description: Whether this output is an error + error_message: anyOf: - type: string - type: 'null' - title: Prompt Set Name - description: Prompt set name + title: Error Message + description: 'Error message in format ''errType: description''' type: object required: - - prompt_id - - prompt_text - title: PromptDetailResponse - description: Detailed prompt response. - PromptInjectionGuardrailSchema: - properties: - action: - $ref: '#/components/schemas/GuardrailAction' - description: 'Action to take: ''allow'', ''block''' - default: BLOCK - type: object - title: PromptInjectionGuardrailSchema - description: Guardrail configuration for prompt injection. - PromptSetSummary: + - uuid + - tsg_id + - custom_attack_id + - job_id + - target_id + - output + title: CustomAttackOutputResponseSchema + description: API response schema — excludes English translation fields. + CustomAttackReportResponse: properties: - prompt_set_id: - type: string - format: uuid - title: Prompt Set Id - description: Custom prompt set UUID - prompt_set_name: - type: string - title: Prompt Set Name - description: Name of the prompt set total_prompts: type: integer title: Total Prompts @@ -1962,3090 +2524,3114 @@ components: type: integer title: Failed Attacks description: Number of failed attacks (no threats detected) - threat_rate: + score: type: number - title: Threat Rate - description: Threat detection rate (0-100) - property_names: - items: - type: string - type: array - title: Property Names - description: List of unique property names in this prompt set - property_statistics: - items: - $ref: '#/components/schemas/PropertyStatistic' - type: array - title: Property Statistics - description: Property-based statistics - type: object - required: - - prompt_set_id - - prompt_set_name - - total_prompts - - total_attacks - - total_threats - - failed_attacks - - threat_rate - title: PromptSetSummary - description: Prompt set summary with statistics. - PromptSetsReportResponse: - properties: - prompt_sets: - items: - $ref: '#/components/schemas/PromptSetSummary' - type: array - title: Prompt Sets - description: List of prompt set summaries - total_prompt_sets: - type: integer - title: Total Prompt Sets - description: Total number of prompt sets - applied_filters: - additionalProperties: true - type: object - title: Applied Filters - description: Filters applied to the results - type: object - required: - - prompt_sets - - total_prompt_sets - title: PromptSetsReportResponse - description: Response for prompt sets with filtering. - PropertyAssignment: - properties: - name: - type: string - title: Name - description: Property name - value: - type: string - title: Value - description: Property value - type: object - required: - - name - - value - title: PropertyAssignment - description: Property assignment for custom attacks. - PropertyStatistic: - properties: - property_name: - type: string - title: Property Name - description: Name of the property - values: + title: Score + description: Overall threat score (0-100) + asr: + type: number + title: Asr + description: Attack Success Rate (0-100) + custom_attack_reports: items: - $ref: '#/components/schemas/PropertyValueStatistic' + $ref: '#/components/schemas/PromptSetSummary' type: array - title: Values - description: Statistics for each property value + title: Custom Attack Reports + description: Reports for each prompt set + property_statistics: + items: + $ref: '#/components/schemas/PropertyStatistic' + type: array + title: Property Statistics + description: Aggregated property statistics type: object required: - - property_name - - values - title: PropertyStatistic - description: Property statistics for prompt sets and job-level aggregation. - PropertyValueStatistic: + - total_prompts + - total_attacks + - total_threats + - failed_attacks + - score + - asr + title: CustomAttackReportResponse + description: Main custom attack report response. + CustomAttacksListResponse: properties: - value: - type: string - title: Value - description: Property value - successful_attack_count: - type: integer - title: Successful Attack Count - description: Number of successful attacks - total_attack_count: + pagination: + $ref: '#/components/schemas/PaginationSchema' + data: + items: + $ref: '#/components/schemas/PromptDetailResponse' + type: array + title: Data + description: List of attack details + total_attacks: type: integer - title: Total Attack Count + title: Total Attacks description: Total number of attacks - success_rate: - type: number - title: Success Rate - description: Auto-calculated success rate percentage + total_threats: + type: integer + title: Total Threats + description: Number of threats detected type: object required: - - value - - successful_attack_count - - total_attack_count - - success_rate - title: PropertyValueStatistic - description: Statistics for a specific property value. - QuotaDetails: + - pagination + - data + - total_attacks + - total_threats + title: CustomAttacksListResponse + description: Enhanced list response for custom attacks. + CustomJobMetadata: properties: - allocated: - type: integer - title: Allocated - description: Total allocated scans for this type - unlimited: + rate_limit_enabled: type: boolean - title: Unlimited - description: Whether this scan type has unlimited quota - consumed: - type: integer - title: Consumed - description: Total consumed scans for this type + title: Rate Limit Enabled + default: false + rate_limit: + anyOf: + - type: integer + - type: 'null' + title: Rate Limit + rate_limit_error_code: + anyOf: + - type: integer + - type: 'null' + title: Rate Limit Error Code + rate_limit_error_message: + anyOf: + - type: string + - type: 'null' + title: Rate Limit Error Message + rate_limit_error_json: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Rate Limit Error Json + content_filter_enabled: + type: boolean + title: Content Filter Enabled + description: Enable content filtering + default: false + content_filter_error_code: + anyOf: + - + type: integer + maximum: 599.0 + minimum: 400.0 + - type: 'null' + title: Content Filter Error Code + description: HTTP error code for content filter (400-599) + content_filter_error_message: + anyOf: + - type: string + - type: 'null' + title: Content Filter Error Message + description: Content filter error message + content_filter_error_json: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Content Filter Error Json + language: + anyOf: + - $ref: '#/components/schemas/LanguageOptionSchema' + - type: 'null' + description: Language for this scan. None = English. + custom_prompt_sets: + items: + type: string + format: uuid + type: array + minItems: 1 + title: Custom Prompt Sets + description: List of custom prompt set UUIDs type: object required: - - allocated - - unlimited - - consumed - title: QuotaDetails - description: Details for a specific scan type quota. - QuotaSummarySchema: + - custom_prompt_sets + title: CustomJobMetadata + description: Enhanced metadata for custom attack jobs. + CustomTopicGuardrailsSchema: properties: - static: - $ref: '#/components/schemas/QuotaDetails' - description: Static scan quota details - dynamic: - $ref: '#/components/schemas/QuotaDetails' - description: Dynamic scan quota details - custom: - $ref: '#/components/schemas/QuotaDetails' - description: Custom scan quota details + action: + $ref: '#/components/schemas/GuardrailAction' + description: 'Action to take: ''allow'', ''block''' + default: BLOCK + blocked_topics: + items: + type: string + type: array + title: Blocked Topics + description: List of blocked topics type: object - required: - - static - - dynamic - - custom - title: QuotaSummarySchema - description: Schema for quota summary response organized by scan type. - RemediationDetailSchema: + title: CustomTopicGuardrailsSchema + description: Custom topic guardrails with blocked topics. + DateRangeFilter: + type: string + enum: + - LAST_7_DAYS + - LAST_15_DAYS + - LAST_30_DAYS + - ALL + title: DateRangeFilter + description: Predefined date range filters for chart APIs. + DynamicJobMetadata: properties: - remediation: - type: string - title: Remediation - description: Remediation recommendation title - description: - type: string - title: Description - description: Detailed description of the remediation - resource_links: + rate_limit_enabled: + type: boolean + title: Rate Limit Enabled + default: false + rate_limit: + anyOf: + - type: integer + - type: 'null' + title: Rate Limit + rate_limit_error_code: + anyOf: + - type: integer + - type: 'null' + title: Rate Limit Error Code + rate_limit_error_message: + anyOf: + - type: string + - type: 'null' + title: Rate Limit Error Message + rate_limit_error_json: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Rate Limit Error Json + content_filter_enabled: + type: boolean + title: Content Filter Enabled + description: Enable content filtering + default: false + content_filter_error_code: + anyOf: + - + type: integer + maximum: 599.0 + minimum: 400.0 + - type: 'null' + title: Content Filter Error Code + description: HTTP error code for content filter (400-599) + content_filter_error_message: + anyOf: + - type: string + - type: 'null' + title: Content Filter Error Message + description: Content filter error message + content_filter_error_json: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Content Filter Error Json + language: + anyOf: + - $ref: '#/components/schemas/LanguageOptionSchema' + - type: 'null' + description: Language for this scan. None = English. + stream_breadth: + type: integer + maximum: 20.0 + minimum: 1.0 + title: Stream Breadth + description: Number of parallel attack streams (1-20) + default: 6 + stream_depth: + type: integer + maximum: 20.0 + minimum: 1.0 + title: Stream Depth + description: Depth of each attack stream (1-20) + default: 10 + max_tokens: + type: integer + maximum: 4096.0 + minimum: 128.0 + title: Max Tokens + description: Maximum tokens per response (128-4096) + default: 256 + context_size: + type: integer + maximum: 20.0 + minimum: 1.0 + title: Context Size + description: Context window size (1-20) + default: 10 + attack_goals: items: type: string type: array - title: Resource Links - description: URLs for additional resources and documentation - priority_level: - type: string - description: Priority level for this remediation - ease_of_implementation_level: - type: string - description: Ease of implementation level for this remediation - effectiveness_level: - type: string - description: Effectiveness rating for this remediation - type: object - required: - - remediation - - description - title: RemediationDetailSchema - RemediationResponseSchema: - properties: - remediations: - items: - $ref: '#/components/schemas/RemediationDetailSchema' - type: array - title: Remediations - description: List of applicable remediation recommendations for static and - dynamic jobs + title: Attack Goals + description: List of attack objectives + base_model: + anyOf: + - type: string + - type: 'null' + title: Base Model + description: Base model identifier + use_case: + anyOf: + - type: string + - type: 'null' + title: Use Case + description: Attack use case description + system_prompt: + anyOf: + - type: string + - type: 'null' + title: System Prompt + description: Custom system prompt type: object - title: RemediationResponseSchema - ResponseMode: - type: string - enum: - - REST - - STREAMING - title: ResponseMode - description: Response mode for target interactions. - RiskLevelSchema: + title: DynamicJobMetadata + description: Enhanced metadata for dynamic attack jobs with proper constraints. + DynamicJobReportSchema: properties: - risk_rating: - $ref: '#/components/schemas/RiskRating' - description: Risk rating level based on job score - total: + total_goals: type: integer - minimum: 0 - title: Total - description: Total count for this risk rating level - targets_by_type: - items: - $ref: '#/components/schemas/CountByNameSchema' - type: array - title: Targets By Type - description: Breakdown by target type (APPLICATION, AGENT, MODEL) - type: object - required: - - risk_rating - - total - title: RiskLevelSchema - description: Risk level breakdown with risk rating and target type counts. - RiskRating: - type: string - enum: - - LOW - - MEDIUM - - HIGH - - CRITICAL - title: RiskRating - description: Risk rating levels with score ranges. - RuntimeSecurityPolicySchema: - properties: - policy_id: - $ref: '#/components/schemas/PolicyType' - description: Runtime Security Policy type - display_name: - type: string - title: Display Name - description: Runtime Security Policy display name - config: + minimum: 0.0 + title: Total Goals + description: Total number of goals tested + default: 0 + total_streams: + type: integer + minimum: 0.0 + title: Total Streams + description: Total number of attack streams + default: 0 + total_threats: + type: integer + minimum: 0.0 + title: Total Threats + description: Total number of threats detected + default: 0 + goals_achieved: + type: integer + minimum: 0.0 + title: Goals Achieved + description: Number of goals with at least one threat + default: 0 + report_summary: anyOf: - - $ref: '#/components/schemas/PromptInjectionGuardrailSchema' - - $ref: '#/components/schemas/ToxicContentGuardrailSchema' - - $ref: '#/components/schemas/CustomTopicGuardrailsSchema' - - $ref: '#/components/schemas/MaliciousCodeDetectionSchema' - - $ref: '#/components/schemas/MaliciousURLDetectionSchema' - - $ref: '#/components/schemas/SensitiveDataProtectionSchema' - title: Config - description: Runtime Security Policy configuration + - type: string + - type: 'null' + title: Report Summary + description: LLM-generated executive summary for the dynamic job + score: + type: number + maximum: 100.0 + minimum: 0.0 + title: Score + description: Overall security score (0-100) + default: 0.0 + asr: + type: number + maximum: 100.0 + minimum: 0.0 + title: Asr + description: Attack Success Rate (0-100) + default: 0.0 type: object - required: - - policy_id - - display_name - - config - title: RuntimeSecurityPolicySchema - description: Runtime security policy configuration. - RuntimeSecurityProfileResponseSchema: + title: DynamicJobReportSchema + description: Core metrics for report generation. + DynamicJobReportStats: properties: - runtime_security_profile: + total_goals: + type: integer + minimum: 0.0 + title: Total Goals + description: Total number of goals tested + default: 0 + total_streams: + type: integer + minimum: 0.0 + title: Total Streams + description: Total number of attack streams + default: 0 + total_threats: + type: integer + minimum: 0.0 + title: Total Threats + description: Total number of threats detected + default: 0 + goals_achieved: + type: integer + minimum: 0.0 + title: Goals Achieved + description: Number of goals with at least one threat + default: 0 + report_summary: anyOf: - - items: - $ref: '#/components/schemas/RuntimeSecurityPolicySchema' - type: array + - type: string - type: 'null' - title: Runtime Security Profile - description: Recommended runtime security profile configuration - type: object - title: RuntimeSecurityProfileResponseSchema - SafetySubCategory: - type: string - enum: - - BIAS - - CBRN - - CYBERCRIME - - DRUGS - - HATE_TOXIC_ABUSE - - NON_VIOLENT_CRIMES - - POLITICAL - - SELF_HARM - - SEXUAL - - VIOLENT_CRIMES_WEAPONS - title: SafetySubCategory - SensitiveDataProtectionSchema: - properties: - action: - $ref: '#/components/schemas/GuardrailAction' - description: 'Action to take: ''allow'', ''block''' - default: BLOCK - masking_sensitive_data: - type: boolean - title: Masking Sensitive Data - description: Whether to mask sensitive data in responses - default: true + title: Report Summary + description: LLM-generated executive summary for the dynamic job type: object - title: SensitiveDataProtectionSchema - description: Guardrail configuration for sensitive data protection. - ScanStatisticsResponseSchema: + title: DynamicJobReportStats + ErrorLogListResponseSchema: properties: - total_scans: - type: integer - minimum: 0 - title: Total Scans - description: Total number of scans - targets_scanned: - type: integer - minimum: 0 - title: Targets Scanned - description: Number of unique targets scanned - targets_scanned_by_type: - items: - $ref: '#/components/schemas/CountByNameSchema' - type: array - title: Targets Scanned By Type - description: Targets scanned grouped by type (APPLICATION, AGENT, MODEL) - scan_status: - items: - $ref: '#/components/schemas/CountByNameSchema' - type: array - title: Scan Status - description: Scan counts by status (COMPLETED, IN_PROGRESS, QUEUED, FAILED) - risk_profile: + pagination: + $ref: '#/components/schemas/PaginationSchema' + data: items: - $ref: '#/components/schemas/RiskLevelSchema' + $ref: '#/components/schemas/ErrorLogListSchema' type: array - title: Risk Profile - description: Risk breakdown by severity level with target type details + title: Data + description: List of error logs type: object required: - - total_scans - - targets_scanned - title: ScanStatisticsResponseSchema - description: 'Dashboard scan statistics response. - - - Endpoint: GET /api/v1/dashboard/scan-statistics - - Returns scan counts, target stats, and risk profile in list format. - - ' - ScoreTrendResponseSchema: + - pagination + - data + title: ErrorLogListResponseSchema + description: Schema for error log list response. + ErrorLogListSchema: properties: - labels: - items: + job_id: + anyOf: + - type: string - type: array - title: Labels - description: Date labels (e.g., 'Jan 1', 'Jan 2') - series: - items: - $ref: '#/components/schemas/ScoreTrendSeriesSchema' - type: array - title: Series - description: Score series per job type + format: uuid + - type: 'null' + title: Job Id + description: UUID of the job associated with this error + target_id: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Target Id + description: UUID of the target associated with this error + target_version: + anyOf: + - type: integer + - type: 'null' + title: Target Version + description: Version of the target configuration when error occurred + attack_id: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Attack Id + description: UUID of the attack attempt that caused the error + error_type: + anyOf: + - $ref: '#/components/schemas/ErrorType' + - type: 'null' + description: Type/category of the error + error_source: + anyOf: + - $ref: '#/components/schemas/ErrorSource' + - type: 'null' + description: Source/origin of the error + error_message: + anyOf: + - type: string + - type: 'null' + title: Error Message + description: Human-readable error message + target_object: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Target Object + description: Snapshot of target configuration at error time + extra_info: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Extra Info + description: Any additional context or metadata + version: + type: integer + title: Version + description: Schema version for future evolution + default: 1 + created_at: + type: string + format: date-time + title: Created At + description: When the error log was created + updated_at: + type: string + format: date-time + title: Updated At + description: When the error log was last updated type: object required: - - labels - - series - title: ScoreTrendResponseSchema - description: 'Response for score trend chart API. - - - Endpoint: GET /api/v1/dashboard/score-trend - - Returns time-series risk scores grouped by job type for chart display. - - ' - ScoreTrendSeriesSchema: + - created_at + - updated_at + title: ErrorLogListSchema + ErrorSource: + type: string + enum: + - TARGET + - JOB + - SYSTEM + - VALIDATION + - TARGET_PROFILING + title: ErrorSource + description: Source/origin of the error. + ErrorType: + type: string + enum: + - CONTENT_FILTER + - RATE_LIMIT + - AUTHENTICATION + - NETWORK + - VALIDATION + - NETWORK_CHANNEL + - TRANSLATION + - UNKNOWN + title: ErrorType + description: Classification of error types. + FileFormat: + type: string + enum: + - CSV + - JSON + - ALL + title: FileFormat + description: File format options for report downloads. + GoalListResponseSchema: properties: - label: - $ref: '#/components/schemas/JobType' - description: Job type for this series + pagination: + $ref: '#/components/schemas/PaginationSchema' data: items: - anyOf: - - type: number - - type: 'null' + $ref: '#/components/schemas/GoalResponseSchema' type: array title: Data - description: Score per date label, null if no completed scan on that date + description: List of Goals type: object required: - - label + - pagination - data - title: ScoreTrendSeriesSchema - description: A single series in the score trend chart. - SecuritySubCategory: - type: string - enum: - - ADVERSARIAL_SUFFIX - - EVASION - - INDIRECT_PROMPT_INJECTION - - JAILBREAK - - MULTI_TURN - - PROMPT_INJECTION - - REMOTE_CODE_EXECUTION - - SYSTEM_PROMPT_LEAK - - TOOL_LEAK - - MALWARE_GENERATION - title: SecuritySubCategory - SentimentRequestSchema: + title: GoalListResponseSchema + description: Response schema for listing attacks following common pagination pattern. + GoalResponseSchema: properties: + goal: + type: string + title: Goal + description: The test goal/prompt + safe_response: + type: string + title: Safe Response + description: The complete safe response with proper refusal + jailbroken_response: + type: string + minLength: 1 + title: Jailbroken Response + description: The complete jailbroken response without disclaimers + goal_metadata: + additionalProperties: true + type: object + title: Goal Metadata + description: Additional metadata + custom_goal: + type: boolean + title: Custom Goal + description: Indicates if it is a custom goal + default: false + goal_type: + $ref: '#/components/schemas/GoalType' + description: 'Goal type: BASE, TOOL_MISUSE, GOAL_MANIPULATION, PRIVILEGE_MISUSE' + default: BASE + uuid: + type: string + format: uuid + title: Uuid + tsg_id: + type: string + title: Tsg Id job_id: type: string format: uuid title: Job Id - description: Id of the job scan - up_vote: - type: boolean - title: Up Vote - description: Up vote for the job scan report summary - default: false - examples: - - false - down_vote: + description: Job identifier + goal_to_show: + anyOf: + - type: string + - type: 'null' + title: Goal To Show + description: Goal to use in the backend + threat: type: boolean - title: Down Vote - description: Down vote for the job scan report summary + title: Threat + description: Indicates if it is a threat default: false - examples: - - false - additionalProperties: false + version: + anyOf: + - type: integer + - type: 'null' + title: Version + description: Goal schema version + extra_info: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Extra Info + description: Extra info + error: + anyOf: + - type: boolean + - type: 'null' + title: Error + description: Whether this goal has errors type: object required: + - goal + - safe_response + - jailbroken_response + - uuid + - tsg_id - job_id - title: SentimentRequestSchema - description: Sentiment Request for report summary. - SentimentResponseSchema: + title: GoalResponseSchema + description: API response schema for Goals. + GoalSchema: properties: + goal: + type: string + title: Goal + description: The test goal/prompt + goal_english: + anyOf: + - type: string + - type: 'null' + title: Goal English + description: English version of goal for judge + safe_response: + type: string + title: Safe Response + description: The complete safe response with proper refusal + jailbroken_response: + type: string + minLength: 1 + title: Jailbroken Response + description: The complete jailbroken response without disclaimers + goal_metadata: + additionalProperties: true + type: object + title: Goal Metadata + description: Additional metadata + custom_goal: + type: boolean + title: Custom Goal + description: Indicates if it is a custom goal + default: false + goal_type: + $ref: '#/components/schemas/GoalType' + description: 'Goal type: BASE, TOOL_MISUSE, GOAL_MANIPULATION, PRIVILEGE_MISUSE' + default: BASE + uuid: + type: string + format: uuid + title: Uuid + tsg_id: + type: string + title: Tsg Id job_id: type: string format: uuid title: Job Id - description: Id of the job scan - up_vote: - type: boolean - title: Up Vote - description: Up vote for the job scan report summary - default: false - examples: - - false - down_vote: + description: Job identifier + goal_to_show: + anyOf: + - type: string + - type: 'null' + title: Goal To Show + description: Goal to use in the backend + threat: type: boolean - title: Down Vote - description: Down vote for the job scan report summary + title: Threat + description: Indicates if it is a threat default: false - examples: - - false - additionalProperties: false + version: + anyOf: + - type: integer + - type: 'null' + title: Version + description: Goal schema version + extra_info: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Extra Info + description: Extra info + error: + anyOf: + - type: boolean + - type: 'null' + title: Error + description: Whether this goal has errors type: object required: + - goal + - safe_response + - jailbroken_response + - uuid + - tsg_id - job_id - title: SentimentResponseSchema - description: Sentiment Response for report summary. - SeverityFilter: + title: GoalSchema + GoalType: type: string enum: - - LOW - - MEDIUM - - HIGH - - CRITICAL - title: SeverityFilter - description: Severity filter enum for API filtering - uses string values. - SeverityReportSchema: + - BASE + - TOOL_MISUSE + - GOAL_MANIPULATION + - PRIVILEGE_MISUSE + title: GoalType + GoalTypeQueryParam: + type: string + enum: + - AGENT + - HUMAN_AUGMENTED + title: GoalTypeQueryParam + GuardrailAction: + type: string + enum: + - ALLOW + - BLOCK + title: GuardrailAction + description: Actions that can be taken by guardrails. + HTTPValidationError: properties: - stats: + detail: items: - $ref: '#/components/schemas/SeverityStatsSchema' + $ref: '#/components/schemas/ValidationError' type: array - title: Stats - description: List of severity statistics - successful: - type: integer - title: Successful - description: Total successful attacks across all severities - default: 0 - failed: - type: integer - title: Failed - description: Total failed attacks across all severities - default: 0 - total_attacks: - type: integer - title: Total Attacks - description: Total number of attacks across all severities - default: 0 + title: Detail type: object - required: - - stats - title: SeverityReportSchema - description: Attack Severity statistics with breakdown by severity level. - SeverityStatsSchema: + title: HTTPValidationError + JobAbortResponseSchema: properties: - severity: + job_id: type: string - description: Severity level (LOW, MEDIUM, HIGH, CRITICAL) - successful: - type: integer - title: Successful - description: Number of successful attacks at this severity - default: 0 - failed: - type: integer - title: Failed - description: Number of failed attacks at this severity - default: 0 + format: uuid + title: Job Id + description: UUID of the aborted job + message: + type: string + title: Message + description: Status message type: object required: - - severity - title: SeverityStatsSchema - description: Breakdown for a single severity level. - StaticJobMetadata: + - job_id + - message + title: JobAbortResponseSchema + description: Response schema for job abort operation. + JobCreateRequestSchema: properties: - rate_limit_enabled: - type: boolean - title: Rate Limit Enabled - default: false - rate_limit: - anyOf: - - type: integer - - type: 'null' - title: Rate Limit - rate_limit_error_code: - anyOf: - - type: integer - - type: 'null' - title: Rate Limit Error Code - rate_limit_error_message: - anyOf: - - type: string - - type: 'null' - title: Rate Limit Error Message - rate_limit_error_json: + name: + type: string + maxLength: 255 + minLength: 3 + title: Name + description: Job name (3-255 characters) + target: + $ref: '#/components/schemas/TargetJobRequest' + description: Target reference for job creation + job_type: + $ref: '#/components/schemas/JobType' + description: Type of job to execute + job_metadata: anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Rate Limit Error Json - content_filter_enabled: - type: boolean - title: Content Filter Enabled - description: Enable content filtering - default: false - content_filter_error_code: + - $ref: '#/components/schemas/StaticJobMetadata' + - $ref: '#/components/schemas/DynamicJobMetadata' + - $ref: '#/components/schemas/CustomJobMetadata' + - $ref: '#/components/schemas/ClaraJobMetadata' + title: Job Metadata + description: Job-specific metadata + version: anyOf: - type: integer - maximum: 599 - minimum: 400 - - type: 'null' - title: Content Filter Error Code - description: HTTP error code for content filter (400-599) - content_filter_error_message: - anyOf: - - type: string - type: 'null' - title: Content Filter Error Message - description: Content filter error message - content_filter_error_json: + title: Version + description: Job version + extra_info: anyOf: - - additionalProperties: true + - + additionalProperties: true type: object - type: 'null' - title: Content Filter Error Json - categories: - additionalProperties: - items: - anyOf: - - $ref: '#/components/schemas/SecuritySubCategory' - - $ref: '#/components/schemas/SafetySubCategory' - - $ref: '#/components/schemas/BrandSubCategory' - - $ref: '#/components/schemas/ComplianceSubCategory' - type: array - propertyNames: - $ref: '#/components/schemas/Category' - type: object - title: Categories - description: Attack categories and their subcategories - example: - COMPLIANCE: - - OWASP - - NIST - SAFETY: - - BIAS - SECURITY: - - ADVERSARIAL_SUFFIX - - JAILBREAK + title: Extra Info + additionalProperties: false type: object required: - - categories - title: StaticJobMetadata - description: Enhanced metadata for static attack jobs with validation. - StaticJobRemediationRecommendationSchema: + - name + - target + - job_type + - job_metadata + title: JobCreateRequestSchema + description: Request schema for creating jobs. + JobListResponseSchema: properties: - runtime_security_policy_configuration: - anyOf: - - items: - $ref: '#/components/schemas/RuntimeSecurityPolicySchema' - type: array - - type: 'null' - title: Runtime Security Policy Configuration - description: Recommended runtime security policy configuration - other_measures: + pagination: + $ref: '#/components/schemas/PaginationSchema' + data: items: - $ref: '#/components/schemas/StaticJobRemediationSchema' + $ref: '#/components/schemas/JobResponseSchema' type: array - title: Other Measures - description: List of applicable remediations for static job + title: Data + description: List of jobs type: object - title: StaticJobRemediationRecommendationSchema - description: Remediation recommendations with security profile and other remediations. - To build and store in db - StaticJobRemediationSchema: + required: + - pagination + - data + title: JobListResponseSchema + description: Response schema for listing jobs following common pagination pattern. + JobResponseSchema: properties: - mapping_remediation_id: + uuid: + type: string + format: uuid + title: Uuid + tsg_id: + type: string + title: Tsg Id + name: + type: string + maxLength: 255 + minLength: 3 + title: Name + description: Job name (3-255 characters) + target: + $ref: '#/components/schemas/TargetReferenceSchema' + description: Full target configuration + job_type: + $ref: '#/components/schemas/JobType' + description: Type of job to execute + job_metadata: anyOf: - - type: string + - $ref: '#/components/schemas/StaticJobMetadata' + - $ref: '#/components/schemas/DynamicJobMetadata' + - $ref: '#/components/schemas/CustomJobMetadata' + - $ref: '#/components/schemas/ClaraJobMetadata' + title: Job Metadata + description: Job-specific metadata + version: + anyOf: + - type: integer - type: 'null' - title: Mapping Remediation Id - description: UUID from remediations.csv identifying this remediation - subcategories: + title: Version + description: Job version + extra_info: anyOf: - - items: - type: string - type: array + - + additionalProperties: true + type: object - type: 'null' - title: Subcategories - description: Subcategories this remediation applies to - effectiveness: - type: integer - title: Effectiveness - description: Effectiveness rating of this remediation (higher is more effective) - default: 0 - ease_of_implementation: - type: integer - title: Ease Of Implementation - description: Ease of implementation rating (higher is easier to implement) - default: 0 - priority: - type: integer - title: Priority - description: Priority level for implementing this remediation (LOW, MEDIUM, - HIGH) - default: 0 - remediation: + title: Extra Info + target_id: type: string - title: Remediation - description: Remediation recommendation title - description: + format: uuid + title: Target Id + description: Target UUID (denormalized) + target_type: type: string - title: Description - description: Detailed description of the remediation - resource_links: - items: - type: string - type: array - title: Resource Links - description: URLs for additional resources and documentation - categories: + title: Target Type + description: 'Target type (APPLICATION, AGENT, MODEL)' + total: anyOf: - - items: - type: string - type: array + - + type: integer + minimum: 0.0 - type: 'null' - title: Categories - description: Categories this remediation applies to (e.g., Security, Safety) - type: object - required: - - remediation - - description - title: StaticJobRemediationSchema - description: Static Job Individual remediation. - StaticJobReportSchema: - properties: - asr: + title: Total + description: Total tasks in job + completed: anyOf: - - type: number - maximum: 100 - minimum: 0 + - + type: integer + minimum: 0.0 - type: 'null' - title: Asr - description: Attack Success Rate percentage (0-100) + title: Completed + description: Completed tasks + status: + $ref: '#/components/schemas/JobStatus' + description: Current job status + default: INIT score: anyOf: - - type: number - maximum: 100 - minimum: 0 + - + type: number + maximum: 100.0 + minimum: 0.0 - type: 'null' title: Score description: Overall job performance score (0-100) - security_report: + asr: anyOf: - - $ref: '#/components/schemas/CategoryReportSchema' + - + type: number + maximum: 100.0 + minimum: 0.0 - type: 'null' - description: Security risk overview widget - safety_report: + title: Asr + description: Updated Attack Success Rate (0-100) + time_record: anyOf: - - $ref: '#/components/schemas/CategoryReportSchema' + - $ref: '#/components/schemas/JobTimeRecord' - type: 'null' - description: Safety risk overview widget - brand_report: + description: Job timing information + created_at: anyOf: - - $ref: '#/components/schemas/CategoryReportSchema' + - + type: string + format: date-time - type: 'null' - description: Brand reputation risk overview widget - compliance_report: + title: Created At + description: Creation timestamp + updated_at: anyOf: - - items: - $ref: '#/components/schemas/ComplianceReportSchema' - type: array + - + type: string + format: date-time - type: 'null' - title: Compliance Report - description: Compliance widget with all frameworks - severity_report: - $ref: '#/components/schemas/SeverityReportSchema' - description: Breakdown of all successful attacks by severity level for the - entire job - report_summary: + title: Updated At + description: Last update timestamp + created_by_user_id: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Created By User Id + description: UUID of the user creating this job + report_stats: + anyOf: + - $ref: '#/components/schemas/StaticJobReportStats' + - $ref: '#/components/schemas/DynamicJobReportStats' + - + additionalProperties: true + type: object + - type: 'null' + title: Report Stats + description: 'Report statistics (StaticJobReportStats for STATIC/CUSTOM jobs, DynamicJobReportStats for DYNAMIC jobs)' + metering_quota_uuid: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Metering Quota Uuid + description: UUID of the metering quota used for this job + counted_towards_quota: + $ref: '#/components/schemas/CountedQuotaEnum' + description: Whether this job is counted towards quota consumption + default: HELD + invocation_id: anyOf: - type: string - type: 'null' - title: Report Summary - description: Report summary from the LLM for the statics job run - recommendations: + title: Invocation Id + description: Restate invocationId of this job + type: object + required: + - uuid + - tsg_id + - name + - target + - job_type + - job_metadata + - target_id + - target_type + title: JobResponseSchema + description: Job response schema. ONLY to be used in API response. + JobStatus: + type: string + enum: + - INIT + - QUEUED + - RUNNING + - COMPLETED + - PARTIALLY_COMPLETE + - FAILED + - ABORTED + title: JobStatus + description: Complete job status enum including internal INIT status. + JobStatusFilter: + type: string + enum: + - QUEUED + - RUNNING + - COMPLETED + - PARTIALLY_COMPLETE + - FAILED + - ABORTED + title: JobStatusFilter + description: Job status enum for API filtering - excludes INIT from public API. + JobTimeRecord: + properties: + queued_at: anyOf: - - $ref: '#/components/schemas/StaticJobRemediationRecommendationSchema' + - + type: string + format: date-time + - type: 'null' + title: Queued At + description: Job queue timestamp + started_at: + anyOf: + - + type: string + format: date-time + - type: 'null' + title: Started At + description: Job start timestamp + completed_at: + anyOf: + - + type: string + format: date-time - type: 'null' - description: Remediation recommendations with security profile and actionable - fixes + title: Completed At + description: Job completion timestamp + time_taken: + anyOf: + - + type: string + format: duration + - type: 'null' + title: Time Taken + description: Total execution time + type: object + title: JobTimeRecord + description: Enhanced time tracking with validation. + JobType: + type: string + enum: + - STATIC + - DYNAMIC + - CUSTOM + - CLARA + title: JobType + description: Type of job execution. + LanguageOptionSchema: + properties: + code: + type: string + title: Code + name: + type: string + title: Name + type: object + required: + - code + - name + title: LanguageOptionSchema + description: Language representation with code and display name. + MaliciousCodeDetectionSchema: + properties: + action: + $ref: '#/components/schemas/GuardrailAction' + description: 'Action to take: ''allow'', ''block''' + default: BLOCK type: object - required: - - severity_report - title: StaticJobReportSchema - description: Complete static job report data structure. - StaticJobReportStats: + title: MaliciousCodeDetectionSchema + description: Guardrail configuration for malicious code detection. + MaliciousURLDetectionSchema: properties: - output_completion_percentage: - type: number - minimum: 0 - title: Output Completion Percentage - description: Percentage of attack outputs that completed successfully (0-100) - partial_report_unlocked: - type: boolean - title: Partial Report Unlocked - description: Whether user has unlocked this partial report with a credit - default: false - partial_report_unlocked_at: - anyOf: - - type: string - format: date-time - - type: 'null' - title: Partial Report Unlocked At - description: Timestamp when the partial report was unlocked - report_summary: + action: + $ref: '#/components/schemas/GuardrailAction' + description: 'Action to take: ''allow'', ''block''' + default: BLOCK + type: object + title: MaliciousURLDetectionSchema + description: Guardrail configuration for malicious URL detection. + PaginationSchema: + properties: + total_items: anyOf: - - type: string + - type: integer - type: 'null' - title: Report Summary - description: Report summary from the LLM for the statics job run + title: Total Items type: object - required: - - output_completion_percentage - title: StaticJobReportStats - description: 'Report statistics for static jobs stored in job.report_stats JSONB - field. - - Tracks output completion and partial report unlock status. - - ' - StatusQueryParam: + title: PaginationSchema + PolicyType: type: string enum: - - SUCCESSFUL - - FAILED - title: StatusQueryParam - StreamDetailResponseSchema: + - PROMPT_INJECTION + - TOXIC_CONTENT + - CUSTOM_TOPIC_GUARDRAILS + - MALICIOUS_CODE_DETECTION + - MALICIOUS_URL_DETECTION + - SENSITIVE_DATA_PROTECTION + title: PolicyType + description: Policy types with metadata. + PrerequisiteModel: properties: - uuid: + id: type: string - format: uuid - title: Uuid - tsg_id: + title: Id + description: Prerequisite unique identifier + display_name: type: string - title: Tsg Id - job_id: + title: Display Name + description: Prerequisite display name for frontend + description: type: string - format: uuid - title: Job Id - description: Job identifier - target_id: + title: Description + description: Prerequisite description + type: object + required: + - id + - display_name + - description + title: PrerequisiteModel + description: Pydantic model for prerequisite data + ProfilingStatus: + type: string + enum: + - INIT + - QUEUED + - IN_PROGRESS + - COMPLETED + - FAILED + - PARTIALLY_COMPLETE + title: ProfilingStatus + description: Status of target profiling workflow. + PromptDetailResponse: + properties: + prompt_id: type: string format: uuid - title: Target Id - description: Target identifier - stream_idx: - type: integer - title: Stream Idx - description: Stream index - default: 0 - iteration: - type: integer - title: Iteration - description: Iteration - default: 0 - goal_id: + title: Prompt Id + description: Prompt UUID + prompt_text: type: string - format: uuid - title: Goal Id - description: Goal identifier + title: Prompt Text + description: The prompt text goal: anyOf: - type: string - type: 'null' title: Goal - description: Goal to use in the backend - marked_safe: + description: Goal of the prompt + user_defined_goal: type: boolean - title: Marked Safe - description: Marked safe + title: User Defined Goal + description: Whether goal is user-defined default: false - stream_type: + properties: + items: + $ref: '#/components/schemas/PropertyAssignment' + type: array + title: Properties + description: Property assignments + attack_id: anyOf: - - $ref: '#/components/schemas/StreamType' + - + type: string + format: uuid - type: 'null' - default: NORMAL + title: Attack Id + description: Associated attack UUID threat: - type: boolean + anyOf: + - type: boolean + - type: 'null' title: Threat - description: Indicates if it is a threat - default: false - first_threat_iteration: + description: Whether threat was detected + attack_outputs: + items: + type: string + type: array + title: Attack Outputs + description: Attack output strings + asr: anyOf: - - $ref: '#/components/schemas/StreamIterationDataSchema' + - + type: number + maximum: 100.0 + minimum: 0.0 - type: 'null' - description: First threat iteration data (denormalized JSONB for performance) - created_at: + title: Asr + description: Attack Success Rate for this prompt (0-100) + prompt_set_id: anyOf: - - type: string - format: date-time + - + type: string + format: uuid - type: 'null' - title: Created At - updated_at: + title: Prompt Set Id + description: Prompt set UUID + prompt_set_name: anyOf: - type: string - format: date-time - type: 'null' - title: Updated At - extra_info: - additionalProperties: true - type: object - title: Extra Info - description: Extra information - version: + title: Prompt Set Name + description: Prompt set name + error: anyOf: - - type: integer + - type: boolean - type: 'null' - title: Version - description: Stream schema version - iterations: + title: Error + description: Whether this attack has errors + type: object + required: + - prompt_id + - prompt_text + title: PromptDetailResponse + description: Detailed prompt response. + PromptInjectionGuardrailSchema: + properties: + action: + $ref: '#/components/schemas/GuardrailAction' + description: 'Action to take: ''allow'', ''block''' + default: BLOCK + type: object + title: PromptInjectionGuardrailSchema + description: Guardrail configuration for prompt injection. + PromptSetSummary: + properties: + prompt_set_id: + type: string + format: uuid + title: Prompt Set Id + description: Custom prompt set UUID + prompt_set_name: + type: string + title: Prompt Set Name + description: Name of the prompt set + total_prompts: + type: integer + title: Total Prompts + description: Total number of unique prompts + total_attacks: + type: integer + title: Total Attacks + description: Total number of attacks executed + total_threats: + type: integer + title: Total Threats + description: Number of threats detected + failed_attacks: + type: integer + title: Failed Attacks + description: Number of failed attacks (no threats detected) + threat_rate: + type: number + title: Threat Rate + description: Threat detection rate (0-100) + property_names: + items: + type: string + type: array + title: Property Names + description: List of unique property names in this prompt set + property_statistics: + items: + $ref: '#/components/schemas/PropertyStatistic' + type: array + title: Property Statistics + description: Property-based statistics + type: object + required: + - prompt_set_id + - prompt_set_name + - total_prompts + - total_attacks + - total_threats + - failed_attacks + - threat_rate + title: PromptSetSummary + description: Prompt set summary with statistics. + PromptSetsReportResponse: + properties: + prompt_sets: items: - $ref: '#/components/schemas/StreamIterationDataSchema' + $ref: '#/components/schemas/PromptSetSummary' type: array - title: Iterations - description: List of iterations + title: Prompt Sets + description: List of prompt set summaries + total_prompt_sets: + type: integer + title: Total Prompt Sets + description: Total number of prompt sets + applied_filters: + additionalProperties: true + type: object + title: Applied Filters + description: Filters applied to the results type: object required: - - uuid - - tsg_id - - job_id - - target_id - - goal_id - title: StreamDetailResponseSchema - StreamIterationDataSchema: + - prompt_sets + - total_prompt_sets + title: PromptSetsReportResponse + description: Response for prompt sets with filtering. + PropertyAssignment: properties: - uuid: - type: string - format: uuid - title: Uuid - tsg_id: + name: type: string - title: Tsg Id - job_id: + title: Name + description: Property name + value: type: string - format: uuid - title: Job Id - description: Job identifier - stream_id: + title: Value + description: Property value + type: object + required: + - name + - value + title: PropertyAssignment + description: Property assignment for custom attacks. + PropertyStatistic: + properties: + property_name: type: string - format: uuid - title: Stream Id - description: Stream identifier - goal_id: + title: Property Name + description: Name of the property + values: + items: + $ref: '#/components/schemas/PropertyValueStatistic' + type: array + title: Values + description: Statistics for each property value + type: object + required: + - property_name + - values + title: PropertyStatistic + description: Property statistics for prompt sets and job-level aggregation. + PropertyValueStatistic: + properties: + value: type: string - format: uuid - title: Goal Id - description: Goal identifier - iteration: + title: Value + description: Property value + successful_attack_count: type: integer - minimum: 0 - title: Iteration - description: Iteration number - prompt: + title: Successful Attack Count + description: Number of successful attacks + total_attack_count: + type: integer + title: Total Attack Count + description: Total number of attacks + success_rate: + type: number + title: Success Rate + description: Auto-calculated success rate percentage + type: object + required: + - value + - successful_attack_count + - total_attack_count + - success_rate + title: PropertyValueStatistic + description: Statistics for a specific property value. + QuotaDetails: + properties: + allocated: + type: integer + title: Allocated + description: Total allocated scans for this type + unlimited: + type: boolean + title: Unlimited + description: Whether this scan type has unlimited quota + consumed: + type: integer + title: Consumed + description: Total consumed scans for this type + type: object + required: + - allocated + - unlimited + - consumed + title: QuotaDetails + description: Details for a specific scan type quota. + QuotaSummarySchema: + properties: + static: + $ref: '#/components/schemas/QuotaDetails' + description: Static scan quota details + dynamic: + $ref: '#/components/schemas/QuotaDetails' + description: Dynamic scan quota details + custom: + $ref: '#/components/schemas/QuotaDetails' + description: Custom scan quota details + type: object + required: + - static + - dynamic + - custom + title: QuotaSummarySchema + description: Schema for quota summary response organized by scan type. + RemediationDetailSchema: + properties: + remediation: type: string - minLength: 1 - title: Prompt - description: The attack prompt - techniques: + title: Remediation + description: Remediation recommendation title + description: type: string - title: Techniques - description: Techniques used in the attack - improvement: + title: Description + description: Detailed description of the remediation + resource_links: + items: + type: string + type: array + title: Resource Links + description: URLs for additional resources and documentation + priority_level: type: string - title: Improvement - description: Improvement strategy for next iteration - prompts_objective: + description: Priority level for this remediation + ease_of_implementation_level: type: string - title: Prompts Objective - description: Objective of the prompt - summary: + description: Ease of implementation level for this remediation + effectiveness_level: type: string - title: Summary - description: Summary of the attack - output: - anyOf: - - type: string - - type: 'null' - title: Output - description: Best target output (highest score) - score: - anyOf: - - type: integer - maximum: 10 - minimum: 0 - - type: 'null' - title: Score - description: Best judge score - default: 0 - judge_reasoning: - anyOf: - - type: string - - type: 'null' - title: Judge Reasoning - description: Judge reasoning for best output - threat: - type: boolean - title: Threat - description: Whether this is a threat (score == 3) - default: false - created_at: - anyOf: - - type: string - format: date-time - - type: 'null' - title: Created At - updated_at: - anyOf: - - type: string - format: date-time - - type: 'null' - title: Updated At - extra_info: + description: Effectiveness rating for this remediation + type: object + required: + - remediation + - description + title: RemediationDetailSchema + RemediationResponseSchema: + properties: + remediations: + items: + $ref: '#/components/schemas/RemediationDetailSchema' + type: array + title: Remediations + description: List of applicable remediation recommendations for static and dynamic jobs + type: object + title: RemediationResponseSchema + ResponseMode: + type: string + enum: + - REST + - STREAMING + - WEBSOCKET + - WEBSOCKET_STREAMING + title: ResponseMode + description: Response mode for target interactions. + RiskLevelSchema: + properties: + risk_rating: + $ref: '#/components/schemas/RiskRating' + description: Risk rating level based on job score + total: + type: integer + minimum: 0.0 + title: Total + description: Total count for this risk rating level + targets_by_type: + items: + $ref: '#/components/schemas/CountByNameSchema' + type: array + title: Targets By Type + description: 'Breakdown by target type (APPLICATION, AGENT, MODEL)' + type: object + required: + - risk_rating + - total + title: RiskLevelSchema + description: Risk level breakdown with risk rating and target type counts. + RiskRating: + type: string + enum: + - LOW + - MEDIUM + - HIGH + - CRITICAL + title: RiskRating + description: Risk rating levels with score ranges. + RuntimeSecurityPolicySchema: + properties: + policy_id: + $ref: '#/components/schemas/PolicyType' + description: Runtime Security Policy type + display_name: + type: string + title: Display Name + description: Runtime Security Policy display name + config: anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Extra Info - description: Extra information - version: + - $ref: '#/components/schemas/PromptInjectionGuardrailSchema' + - $ref: '#/components/schemas/ToxicContentGuardrailSchema' + - $ref: '#/components/schemas/CustomTopicGuardrailsSchema' + - $ref: '#/components/schemas/MaliciousCodeDetectionSchema' + - $ref: '#/components/schemas/MaliciousURLDetectionSchema' + - $ref: '#/components/schemas/SensitiveDataProtectionSchema' + title: Config + description: Runtime Security Policy configuration + type: object + required: + - policy_id + - display_name + - config + title: RuntimeSecurityPolicySchema + description: Runtime security policy configuration. + RuntimeSecurityProfileResponseSchema: + properties: + runtime_security_profile: anyOf: - - type: integer + - + items: + $ref: '#/components/schemas/RuntimeSecurityPolicySchema' + type: array - type: 'null' - title: Version - description: Stream Iter data schema version + title: Runtime Security Profile + description: Recommended runtime security profile configuration + type: object + title: RuntimeSecurityProfileResponseSchema + SafetySubCategory: + type: string + enum: + - BIAS + - CBRN + - CYBERCRIME + - DRUGS + - HATE_TOXIC_ABUSE + - NON_VIOLENT_CRIMES + - POLITICAL + - SELF_HARM + - SEXUAL + - VIOLENT_CRIMES_WEAPONS + title: SafetySubCategory + ScanStatisticsResponseSchema: + properties: + total_scans: + type: integer + minimum: 0.0 + title: Total Scans + description: Total number of scans + targets_scanned: + type: integer + minimum: 0.0 + title: Targets Scanned + description: Number of unique targets scanned + targets_scanned_by_type: + items: + $ref: '#/components/schemas/CountByNameSchema' + type: array + title: Targets Scanned By Type + description: 'Targets scanned grouped by type (APPLICATION, AGENT, MODEL)' + scan_status: + items: + $ref: '#/components/schemas/CountByNameSchema' + type: array + title: Scan Status + description: 'Scan counts by status (COMPLETED, IN_PROGRESS, QUEUED, FAILED)' + risk_profile: + items: + $ref: '#/components/schemas/RiskLevelSchema' + type: array + title: Risk Profile + description: Risk breakdown by severity level with target type details type: object required: - - uuid - - tsg_id - - job_id - - stream_id - - goal_id - - iteration - - prompt - - techniques - - improvement - - prompts_objective - - summary - title: StreamIterationDataSchema - description: Main stream iteration data - one row per iteration. - StreamListResponseSchema: + - total_scans + - targets_scanned + title: ScanStatisticsResponseSchema + description: | + Dashboard scan statistics response. + + Endpoint: GET /api/v1/dashboard/scan-statistics + Returns scan counts, target stats, and risk profile in list format. + ScoreTrendResponseSchema: properties: - pagination: - $ref: '#/components/schemas/PaginationSchema' + labels: + items: + type: string + type: array + title: Labels + description: 'Date labels (e.g., ''Jan 1'', ''Jan 2'')' + series: + items: + $ref: '#/components/schemas/ScoreTrendSeriesSchema' + type: array + title: Series + description: Score series per job type + type: object + required: + - labels + - series + title: ScoreTrendResponseSchema + description: | + Response for score trend chart API. + + Endpoint: GET /api/v1/dashboard/score-trend + Returns time-series risk scores grouped by job type for chart display. + ScoreTrendSeriesSchema: + properties: + label: + $ref: '#/components/schemas/JobType' + description: Job type for this series data: items: - $ref: '#/components/schemas/StreamSchema' + anyOf: + - type: number + - type: 'null' type: array title: Data - description: List of streams + description: 'Score per date label, null if no completed scan on that date' type: object required: - - pagination + - label - data - title: StreamListResponseSchema - description: Response schema for listing attacks following common pagination - pattern. - StreamSchema: + title: ScoreTrendSeriesSchema + description: A single series in the score trend chart. + SecuritySubCategory: + type: string + enum: + - ADVERSARIAL_SUFFIX + - EVASION + - INDIRECT_PROMPT_INJECTION + - JAILBREAK + - MULTI_TURN + - PROMPT_INJECTION + - REMOTE_CODE_EXECUTION + - SYSTEM_PROMPT_LEAK + - TOOL_LEAK + - MALWARE_GENERATION + title: SecuritySubCategory + SensitiveDataProtectionSchema: properties: - uuid: - type: string - format: uuid - title: Uuid - tsg_id: - type: string - title: Tsg Id - job_id: - type: string - format: uuid - title: Job Id - description: Job identifier - target_id: - type: string - format: uuid - title: Target Id - description: Target identifier - stream_idx: - type: integer - title: Stream Idx - description: Stream index - default: 0 - iteration: - type: integer - title: Iteration - description: Iteration - default: 0 - goal_id: - type: string - format: uuid - title: Goal Id - description: Goal identifier - goal: - anyOf: - - $ref: '#/components/schemas/GoalSchema' - - type: string - - type: 'null' - title: Goal - description: Goal to use in the backend - marked_safe: - type: boolean - title: Marked Safe - description: Marked safe - default: false - stream_type: - anyOf: - - $ref: '#/components/schemas/StreamType' - - type: 'null' - default: NORMAL - threat: + action: + $ref: '#/components/schemas/GuardrailAction' + description: 'Action to take: ''allow'', ''block''' + default: BLOCK + masking_sensitive_data: type: boolean - title: Threat - description: Indicates if it is a threat - default: false - first_threat_iteration: - anyOf: - - $ref: '#/components/schemas/StreamIterationDataSchema' - - type: 'null' - description: First threat iteration data (denormalized JSONB for performance) - created_at: - anyOf: - - type: string - format: date-time - - type: 'null' - title: Created At - updated_at: - anyOf: - - type: string - format: date-time - - type: 'null' - title: Updated At - extra_info: - additionalProperties: true - type: object - title: Extra Info - description: Extra information - version: - anyOf: - - type: integer - - type: 'null' - title: Version - description: Stream schema version + title: Masking Sensitive Data + description: Whether to mask sensitive data in responses + default: true type: object - required: - - uuid - - tsg_id - - job_id - - target_id - - goal_id - title: StreamSchema - StreamType: - type: string - enum: - - NORMAL - - ADVERSARIAL - title: StreamType - SubCategoryModel: + title: SensitiveDataProtectionSchema + description: Guardrail configuration for sensitive data protection. + SentimentRequestSchema: properties: - id: - type: string - title: Id - description: Unique identifier - display_name: - type: string - title: Display Name - description: Frontend display name - description: + job_id: type: string - title: Description - description: Description - preselect: + format: uuid + title: Job Id + description: Id of the job scan + up_vote: type: boolean - title: Preselect - description: Whether this subcategory should be preselected in UI - default: true - prerequisites: - anyOf: - - items: - $ref: '#/components/schemas/PrerequisiteModel' - type: array - - type: 'null' - title: Prerequisites - description: List of prerequisites for this subcategory - active: + title: Up Vote + description: Up vote for the job scan report summary + default: false + examples: + - false + down_vote: type: boolean - title: Active - description: Whether this subcategory is active - default: true + title: Down Vote + description: Down vote for the job scan report summary + default: false + examples: + - false + additionalProperties: false type: object required: - - id - - display_name - - description - title: SubCategoryModel - description: Pydantic model for subcategory data - SubCategoryStatsSchema: + - job_id + title: SentimentRequestSchema + description: Sentiment Request for report summary. + SentimentResponseSchema: properties: - id: - type: string - title: Id - description: Unique identifier - display_name: - type: string - title: Display Name - description: Frontend display name - description: + job_id: type: string - title: Description - description: Description - preselect: + format: uuid + title: Job Id + description: Id of the job scan + up_vote: type: boolean - title: Preselect - description: Whether this subcategory should be preselected in UI - default: true - prerequisites: - anyOf: - - items: - $ref: '#/components/schemas/PrerequisiteModel' - type: array - - type: 'null' - title: Prerequisites - description: List of prerequisites for this subcategory - active: + title: Up Vote + description: Up vote for the job scan report summary + default: false + examples: + - false + down_vote: type: boolean - title: Active - description: Whether this subcategory is active - default: true + title: Down Vote + description: Down vote for the job scan report summary + default: false + examples: + - false + additionalProperties: false + type: object + required: + - job_id + title: SentimentResponseSchema + description: Sentiment Response for report summary. + SeverityFilter: + type: string + enum: + - LOW + - MEDIUM + - HIGH + - CRITICAL + title: SeverityFilter + description: Severity filter enum for API filtering - uses string values. + SeverityReportSchema: + properties: + stats: + items: + $ref: '#/components/schemas/SeverityStatsSchema' + type: array + title: Stats + description: List of severity statistics successful: type: integer title: Successful - description: Number of successful attacks (threat=True) + description: Total successful attacks across all severities + default: 0 failed: type: integer title: Failed - description: Number of failed attacks (threat=False) - total: + description: Total failed attacks across all severities + default: 0 + total_attacks: type: integer - title: Total - description: Total attacks for this subcategory (successful + failed) + title: Total Attacks + description: Total number of attacks across all severities default: 0 type: object required: - - id - - display_name - - description - - successful - - failed - title: SubCategoryStatsSchema - description: Statistics for a specific subcategory. - TargetAdditionalContext: - properties: - base_model: - anyOf: - - type: string - - type: 'null' - title: Base Model - description: Base model name (e.g., GPT-4, Claude) - core_architecture: - anyOf: - - type: string - - type: 'null' - title: Core Architecture - description: Core architecture details - system_prompt: - anyOf: - - type: string - - type: 'null' - title: System Prompt - description: System prompt - languages_supported: - anyOf: - - items: - type: string - type: array - - type: 'null' - title: Languages Supported - description: Supported languages - banned_keywords: - anyOf: - - items: - type: string - type: array - - type: 'null' - title: Banned Keywords - description: Banned keywords/phrases - tools_accessible: - anyOf: - - items: - type: string - type: array - - type: 'null' - title: Tools Accessible - description: Accessible tools/capabilities - type: object - title: TargetAdditionalContext - description: 'Additional context - used in create/update API requests and stored - in DB/GCS. - - - Single value fields are strings. - - List fields are lists of strings. - - ' - TargetBackground: - properties: - industry: - anyOf: - - type: string - - type: 'null' - title: Industry - description: Target's industry (e.g., Healthcare, Finance) - use_case: - anyOf: - - type: string - - type: 'null' - title: Use Case - description: Primary use case (e.g., Customer Support, Code Assistant) - competitors: - anyOf: - - items: - type: string - type: array - - type: 'null' - title: Competitors - description: Known competitor products - type: object - title: TargetBackground - description: 'Target background - used in create/update API requests and stored - in DB/GCS. - - - Required fields for activation: - - - industry (string, required) - - - use_case (string, required) - - - Optional field: - - - competitors (list of strings) - - ' - TargetConnectionType: - type: string - enum: - - DATABRICKS - - BEDROCK - - OPENAI - - HUGGING_FACE - - CUSTOM - - REST - - STREAMING - title: TargetConnectionType - description: Connection type/provider for the target. - TargetJobRequest: + - stats + title: SeverityReportSchema + description: Attack Severity statistics with breakdown by severity level. + SeverityStatsSchema: properties: - uuid: + severity: type: string - format: uuid - title: Uuid - description: Target UUID - version: - anyOf: - - type: integer - - type: 'null' - title: Version - description: Target configuration version + description: 'Severity level (LOW, MEDIUM, HIGH, CRITICAL)' + successful: + type: integer + title: Successful + description: Number of successful attacks at this severity + default: 0 + failed: + type: integer + title: Failed + description: Number of failed attacks at this severity + default: 0 type: object required: - - uuid - title: TargetJobRequest - description: Enhanced request schema for targeting specific targets. - TargetMetadata: + - severity + title: SeverityStatsSchema + description: Breakdown for a single severity level. + StaticJobMetadata: properties: - multi_turn: + rate_limit_enabled: type: boolean - title: Multi Turn - description: Whether target supports multi-turn conversations (Probe 2 result) + title: Rate Limit Enabled default: false - multi_turn_error_message: - anyOf: - - type: string - - type: 'null' - title: Multi Turn Error Message - description: Concise error message if Probe 2 failed - examples: - - Session ID extraction failed - - Assistant role not configured rate_limit: anyOf: - type: integer - type: 'null' title: Rate Limit - description: Current rate limit value - examples: - - 996 - rate_limit_enabled: - type: boolean - title: Rate Limit Enabled - description: Whether rate limiting is enabled - default: false rate_limit_error_code: anyOf: - type: integer - type: 'null' title: Rate Limit Error Code - description: HTTP status code for rate limit errors - examples: - - 429 - rate_limit_error_json: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Rate Limit Error Json - description: JSON structure of rate limit error response - examples: - - error: - code: rate_limit_exceeded - message: 'Rate limit reached for o1-preview on requests per min (RPM): - Limit 20, Used 20, Requested 1. Please try again in 3s. Visit https://platform.openai.com/account/rate-limits - to learn more.' - param: 'null' - type: requests rate_limit_error_message: anyOf: - type: string - type: 'null' title: Rate Limit Error Message - description: Raw error message string for rate limit errors - examples: - - 'Rate limit reached for o1-preview on requests per min (RPM): Limit 20, - Used 20, Requested 1. Please try again in 3s.' + rate_limit_error_json: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Rate Limit Error Json content_filter_enabled: type: boolean title: Content Filter Enabled - description: Whether content filtering is enabled + description: Enable content filtering default: false content_filter_error_code: anyOf: - - type: integer + - + type: integer + maximum: 599.0 + minimum: 400.0 - type: 'null' title: Content Filter Error Code - description: HTTP status code for content filter errors - examples: - - 400 - content_filter_error_json: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Content Filter Error Json - description: JSON structure of content filter error response - examples: - - error: - code: invalid_prompt - message: 'Invalid prompt: your prompt was flagged as potentially violating - our usage policy. Please try again with a different prompt.' - type: invalid_request_error + description: HTTP error code for content filter (400-599) content_filter_error_message: anyOf: - type: string - type: 'null' title: Content Filter Error Message - description: Raw error message string for content filter errors - examples: - - 'Invalid prompt: your prompt was flagged as potentially violating our - usage policy. Please try again with a different prompt.' - probe_message: - type: string - title: Probe Message - default: Hello, this is a test message from the red team validation system. - request_timeout: - type: number - title: Request Timeout - description: Request timeout in seconds - default: 110 - examples: - - 110 - type: object - title: TargetMetadata - description: Metadata stored in the database for targets (user-provided + computed - fields). - TargetReferenceSchema: - properties: - uuid: - type: string - format: uuid - title: Uuid - tsg_id: - type: string - title: Tsg Id - name: - type: string - title: Name - description: Target name - examples: - - GPT 4.1 Nano - description: - anyOf: - - type: string - - type: 'null' - title: Description - description: Optional target description - default: null - examples: - - AI model for testing - target_type: - anyOf: - - $ref: '#/components/schemas/TargetType' - - type: 'null' - description: Type of target - connection_type: - anyOf: - - $ref: '#/components/schemas/TargetConnectionType' - - type: 'null' - description: Connection type/provider for the target - examples: - - CUSTOM - - OPENAI - - BEDROCK - api_endpoint_type: - anyOf: - - $ref: '#/components/schemas/ApiEndpointType' - - type: 'null' - description: Accessibility type of the API endpoint - examples: - - PUBLIC - - PRIVATE - - NETWORK_BROKER - response_mode: - anyOf: - - $ref: '#/components/schemas/ResponseMode' - - type: 'null' - description: Response mode for API interactions - examples: - - REST - - STREAMING - session_supported: - type: boolean - title: Session Supported - description: Whether target supports session for multi-turn conversations - default: false - extra_info: + description: Content filter error message + content_filter_error_json: anyOf: - - additionalProperties: true + - + additionalProperties: true type: object - type: 'null' - title: Extra Info - description: Additional configuration or metadata for the target - default: null - examples: - - custom_key: custom_value - status: - $ref: '#/components/schemas/TargetStatus' - description: Target status - active: - type: boolean - title: Active - description: Whether target is active - validated: - type: boolean - title: Validated - description: Whether target is validated - version: - anyOf: - - type: integer - - type: 'null' - title: Version - description: Configuration version - secret_version: - anyOf: - - type: string - - type: 'null' - title: Secret Version - description: Secret Manager version for connection_params. When present, - sensitive connection data is stored in Secret Manager. When None, connection_params - are stored in GCS (legacy). - created_by_user_id: - anyOf: - - type: string - format: uuid - - type: 'null' - title: Created By User Id - description: User ID of target creator - updated_by_user_id: + title: Content Filter Error Json + language: anyOf: - - type: string - format: uuid + - $ref: '#/components/schemas/LanguageOptionSchema' - type: 'null' - title: Updated By User Id - description: User ID of last target updater - created_at: - type: string - format: date-time - title: Created At - description: Creation timestamp - updated_at: - type: string - format: date-time - title: Updated At - description: Last update timestamp - target_metadata: - $ref: '#/components/schemas/TargetMetadata' - description: Target metadata and configuration options - target_background: + description: Language for this scan. None = English. + categories: + additionalProperties: + items: + anyOf: + - $ref: '#/components/schemas/SecuritySubCategory' + - $ref: '#/components/schemas/SafetySubCategory' + - $ref: '#/components/schemas/BrandSubCategory' + - $ref: '#/components/schemas/ComplianceSubCategory' + type: array + propertyNames: + $ref: '#/components/schemas/Category' + type: object + title: Categories + description: Attack categories and their subcategories + example: + COMPLIANCE: + - OWASP + - NIST + SAFETY: + - BIAS + SECURITY: + - ADVERSARIAL_SUFFIX + - JAILBREAK + type: object + required: + - categories + title: StaticJobMetadata + description: Enhanced metadata for static attack jobs with validation. + StaticJobRemediationRecommendationSchema: + properties: + runtime_security_policy_configuration: anyOf: - - $ref: '#/components/schemas/TargetBackground' + - + items: + $ref: '#/components/schemas/RuntimeSecurityPolicySchema' + type: array - type: 'null' - description: 'Target background info: industry, use_case, competitors' - profiling_status: + title: Runtime Security Policy Configuration + description: Recommended runtime security policy configuration + other_measures: + items: + $ref: '#/components/schemas/StaticJobRemediationSchema' + type: array + title: Other Measures + description: List of applicable remediations for static job + type: object + title: StaticJobRemediationRecommendationSchema + description: Remediation recommendations with security profile and other remediations. To build and store in db + StaticJobRemediationSchema: + properties: + mapping_remediation_id: anyOf: - - $ref: '#/components/schemas/ProfilingStatus' + - type: string - type: 'null' - description: Status of the profiling workflow - additional_context: + title: Mapping Remediation Id + description: UUID from remediations.csv identifying this remediation + subcategories: anyOf: - - $ref: '#/components/schemas/TargetAdditionalContext' + - + items: + type: string + type: array - type: 'null' - description: Additional context with source tracking (user + profiler) - type: object - required: - - uuid - - tsg_id - - name - - status - - active - - validated - - created_at - - updated_at - title: TargetReferenceSchema - TargetStatus: - type: string - enum: - - DRAFT - - VALIDATING - - VALIDATED - - ACTIVE - - INACTIVE - - FAILED - - PENDING_AUTH - title: TargetStatus - description: Status enumeration for scan targets. - TargetType: - type: string - enum: - - APPLICATION - - AGENT - - MODEL - title: TargetType - description: Target Types Available - TechniqueModel: - properties: - id: - type: string - title: Id - description: Technique unique identifier - display_name: - type: string - title: Display Name - description: Technique display name for frontend - compliance_id: + title: Subcategories + description: Subcategories this remediation applies to + effectiveness: + type: integer + title: Effectiveness + description: Effectiveness rating of this remediation (higher is more effective) + default: 0 + ease_of_implementation: + type: integer + title: Ease Of Implementation + description: Ease of implementation rating (higher is easier to implement) + default: 0 + priority: + type: integer + title: Priority + description: 'Priority level for implementing this remediation (LOW, MEDIUM, HIGH)' + default: 0 + remediation: type: string - title: Compliance Id - description: Associated compliance framework ID + title: Remediation + description: Remediation recommendation title description: type: string title: Description - description: Technique description - link: - type: string - title: Link - description: Technique documentation link - version: - type: string - title: Version - description: Technique version - active: - type: boolean - title: Active - description: Whether technique is active - type: object - required: - - id - - display_name - - compliance_id - - description - - link - - version - - active - title: TechniqueModel - description: Pydantic model for technique data - ToxicContentGuardrailSchema: - properties: - moderate: - $ref: '#/components/schemas/GuardrailAction' - description: 'Action for moderate toxicity: ''allow'', ''block''' - default: BLOCK - high: - $ref: '#/components/schemas/GuardrailAction' - description: 'Action for high toxicity: ''allow'', ''block''' - default: BLOCK - type: object - title: ToxicContentGuardrailSchema - description: Guardrail configuration for toxic content with severity levels. - ValidationError: - properties: - loc: + description: Detailed description of the remediation + resource_links: items: - anyOf: - - type: string - - type: integer + type: string type: array - title: Location - msg: - type: string - title: Message - type: - type: string - title: Error Type + title: Resource Links + description: URLs for additional resources and documentation + categories: + anyOf: + - + items: + type: string + type: array + - type: 'null' + title: Categories + description: 'Categories this remediation applies to (e.g., Security, Safety)' type: object required: - - loc - - msg - - type - title: ValidationError -ExternalTags: - Categories: - title: Categories - description: Operations for managing scan categories. - tags: - - Categories - CustomAttack: - title: CustomAttack - description: Operations for custom attack configurations and prompts. - tags: - - CustomAttack - ErrorLogs: - title: ErrorLogs - description: Operations for retrieving and managing error logs. - tags: - - ErrorLogs - Dashboard: - title: Dashboard - description: Operations for dashboard data and statistics. - tags: - - Dashboard - HealthChecks: - title: HealthChecks - description: Operations related to health checks of the data plane service. - tags: - - HealthChecks - Quota: - title: Quota - description: Operations for quota management and limits. - tags: - - Quota - Scan: - title: Scan - description: Operations for creating and managing scan jobs. - tags: - - Scan - Report: - title: Report - description: Operations for generating and retrieving scan job reports for static - and dynamic. - tags: - - Report - Sentiment: - title: Sentiment - description: Operations for managing sentiment and scan report summaries. - tags: - - Sentiment -paths: - /ready: - get: - summary: Readiness - description: Retrieve the ready details through this Application Programming - Interface endpoint. - operationId: readiness_ready_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - title: Response Readiness Ready Get - 401: - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: [] - tags: - - HealthChecks - /liveness: - get: - summary: Liveness - description: Retrieve the liveness details through this Application Programming - Interface endpoint. - operationId: liveness_liveness_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - additionalProperties: - type: boolean - type: object - title: Response Liveness Liveness Get - 401: - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: [] - tags: - - HealthChecks - /v1/scan: - post: - summary: Create scan - description: Create a new scan target. - operationId: create_job_v1_scan_post - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/JobResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: [] - tags: - - Scan - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/JobCreateRequestSchema' - get: - summary: List scans - description: List jobs with filtering and pagination. - operationId: list_jobs_v1_scan_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/JobListResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: limit - in: query - required: false - schema: - type: integer - maximum: 100 - minimum: 1 - description: Number of jobs to return (1-100) - default: 50 - title: Limit - description: Number of jobs to return (1-100) - - name: skip - in: query - required: false - schema: - type: integer - minimum: 0 - description: Number of jobs to skip for pagination - default: 0 - title: Skip - description: Number of jobs to skip for pagination - - name: status - in: query - required: false - schema: + - remediation + - description + title: StaticJobRemediationSchema + description: Static Job Individual remediation. + StaticJobReportSchema: + properties: + asr: + anyOf: + - + type: number + maximum: 100.0 + minimum: 0.0 + - type: 'null' + title: Asr + description: Attack Success Rate percentage (0-100) + score: anyOf: - - $ref: '#/components/schemas/JobStatusFilter' + - + type: number + maximum: 100.0 + minimum: 0.0 - type: 'null' - description: Filter by job status - title: Status - description: Filter by job status - - name: job_type - in: query - required: false - schema: + title: Score + description: Overall job performance score (0-100) + security_report: anyOf: - - $ref: '#/components/schemas/JobType' + - $ref: '#/components/schemas/CategoryReportSchema' - type: 'null' - description: Filter by job type - title: Job Type - description: Filter by job type - - name: search - in: query - required: false - schema: + description: Security risk overview widget + safety_report: + anyOf: + - $ref: '#/components/schemas/CategoryReportSchema' + - type: 'null' + description: Safety risk overview widget + brand_report: + anyOf: + - $ref: '#/components/schemas/CategoryReportSchema' + - type: 'null' + description: Brand reputation risk overview widget + compliance_report: + anyOf: + - + items: + $ref: '#/components/schemas/ComplianceReportSchema' + type: array + - type: 'null' + title: Compliance Report + description: Compliance widget with all frameworks + severity_report: + $ref: '#/components/schemas/SeverityReportSchema' + description: Breakdown of all successful attacks by severity level for the entire job + report_summary: anyOf: - type: string - maxLength: 255 - type: 'null' - description: Search jobs by name - title: Search - description: Search jobs by name - - name: target_id - in: query - required: false - schema: + title: Report Summary + description: Report summary from the LLM for the statics job run + recommendations: + anyOf: + - $ref: '#/components/schemas/StaticJobRemediationRecommendationSchema' + - type: 'null' + description: Remediation recommendations with security profile and actionable fixes + type: object + required: + - severity_report + title: StaticJobReportSchema + description: Complete static job report data structure. + StaticJobReportStats: + properties: + output_completion_percentage: + type: number + minimum: 0.0 + title: Output Completion Percentage + description: Percentage of attack outputs that completed successfully (0-100) + partial_report_unlocked: + type: boolean + title: Partial Report Unlocked + description: Whether user has unlocked this partial report with a credit + default: false + partial_report_unlocked_at: + anyOf: + - + type: string + format: date-time + - type: 'null' + title: Partial Report Unlocked At + description: Timestamp when the partial report was unlocked + report_summary: anyOf: - type: string - format: uuid - type: 'null' - description: Filter by target UUID - title: Target Id - description: Filter by target UUID - tags: - - Scan - /v1/scan/{job_id}: - get: - summary: Get scan details - description: Get a job by its ID. - operationId: get_job_v1_scan__job_id__get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/JobResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: + title: Report Summary + description: Report summary from the LLM for the statics job run + type: object + required: + - output_completion_percentage + title: StaticJobReportStats + description: | + Report statistics for static jobs stored in job.report_stats JSONB field. + Tracks output completion and partial report unlock status. + StatusQueryParam: + type: string + enum: + - SUCCESSFUL + - FAILED + - ERROR + title: StatusQueryParam + StreamDetailResponseSchema: + properties: + uuid: type: string format: uuid - title: Job Id - tags: - - Scan - /v1/scan/{job_id}/abort: - post: - summary: Abort scan - description: Abort a running job by cancelling its workflow and updating status. - operationId: abort_job_v1_scan__job_id__abort_post - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/JobAbortResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: + title: Uuid + tsg_id: + type: string + title: Tsg Id + job_id: type: string format: uuid title: Job Id - tags: - - Scan - /v1/categories: - get: - summary: Get all categories with subcategories - description: Get all available categories with their subcategories. - operationId: get_all_categories_v1_categories_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - items: - $ref: '#/components/schemas/CategoryModel' - type: array - title: Response Get All Categories V1 Categories Get - 401: - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: [] - tags: - - Categories - /v1/report/static/{job_id}/list-attacks: - get: - summary: List attacks for a scan - description: List attacks with filtering and pagination. - operationId: list_attacks_v1_report_static__job_id__list_attacks_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/AttackListResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: + description: Job identifier + target_id: type: string format: uuid - title: Job Id - - name: limit - in: query - required: false - schema: + title: Target Id + description: Target identifier + stream_idx: type: integer - maximum: 100 - minimum: 1 - description: Number of attacks to return (1-100) - default: 50 - title: Limit - description: Number of attacks to return (1-100) - - name: skip - in: query - required: false - schema: + title: Stream Idx + description: Stream index + default: 0 + iteration: type: integer - minimum: 0 - description: Number of attacks to skip for pagination + title: Iteration + description: Iteration default: 0 - title: Skip - description: Number of attacks to skip for pagination - - name: status - in: query - required: false - schema: + goal_id: + type: string + format: uuid + title: Goal Id + description: Goal identifier + goal: + anyOf: + - type: string + - type: 'null' + title: Goal + description: Goal to use in the backend + marked_safe: + type: boolean + title: Marked Safe + description: Marked safe + default: false + stream_type: + anyOf: + - $ref: '#/components/schemas/StreamType' + - type: 'null' + default: NORMAL + threat: + type: boolean + title: Threat + description: Indicates if it is a threat + default: false + first_threat_iteration: anyOf: - - $ref: '#/components/schemas/AttackStatus' + - $ref: '#/components/schemas/StreamIterationDataSchema' - type: 'null' - description: Filter by attack status - title: Status - description: Filter by attack status - - name: attack_type - in: query - required: false - schema: + description: First threat iteration data (denormalized JSONB for performance) + created_at: anyOf: - - $ref: '#/components/schemas/AttackType' + - + type: string + format: date-time - type: 'null' - description: Filter by attack type - title: Attack Type - description: Filter by attack type - - name: category - in: query - required: false - schema: + title: Created At + updated_at: anyOf: - - $ref: '#/components/schemas/Category' + - + type: string + format: date-time - type: 'null' - description: Filter by attack category - title: Category - description: Filter by attack category - - name: sub_category - in: query - required: false - schema: + title: Updated At + extra_info: + additionalProperties: true + type: object + title: Extra Info + description: Extra information + version: anyOf: - - $ref: '#/components/schemas/SecuritySubCategory' - - $ref: '#/components/schemas/SafetySubCategory' - - $ref: '#/components/schemas/BrandSubCategory' + - type: integer - type: 'null' - description: Filter by attack subcategory - title: Sub Category - description: Filter by attack subcategory - - name: threat - in: query - required: false - schema: + title: Version + description: Stream schema version + error: anyOf: - type: boolean - type: 'null' - description: Filter by threat status - title: Threat - description: Filter by threat status - - name: severity - in: query - required: false - schema: + title: Error + description: Whether this stream encountered errors + error_message: anyOf: - - $ref: '#/components/schemas/SeverityFilter' + - type: string - type: 'null' - description: Filter by severity level - title: Severity - description: Filter by severity level - tags: - - Report - /v1/report/static/{job_id}/attack/{attack_id}: - get: - summary: Get attack details - description: Get detailed attack information including outputs and framework - techniques. - operationId: get_attack_detail_v1_report_static__job_id__attack__attack_id__get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/AttackDetailResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: + title: Error Message + description: Error message details + iterations: + items: + $ref: '#/components/schemas/StreamIterationDataResponseSchema' + type: array + title: Iterations + description: List of iterations + type: object + required: + - uuid + - tsg_id + - job_id + - target_id + - goal_id + title: StreamDetailResponseSchema + StreamIterationDataResponseSchema: + properties: + uuid: + type: string + format: uuid + title: Uuid + tsg_id: + type: string + title: Tsg Id + job_id: type: string format: uuid title: Job Id - - name: attack_id - in: path - required: true - schema: + description: Job identifier + stream_id: type: string format: uuid - title: Attack Id - tags: - - Report - /v1/report/static/{job_id}/report: - get: - summary: Get attack library report - description: Get attack library report for a job. Raises ForbiddenError if - report is partially complete and locked. - operationId: get_attack_report_v1_report_static__job_id__report_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/StaticJobReportSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: + title: Stream Id + description: Stream identifier + goal_id: type: string format: uuid - title: Job Id - tags: - - Report - /v1/report/static/{job_id}/remediation: - get: - summary: Get attack library scan remediation - description: Get other remediation measures for a static job. - operationId: get_static_remediations_v1_report_static__job_id__remediation_get - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/RemediationResponseSchema' - '422': - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: + title: Goal Id + description: Goal identifier + iteration: + type: integer + minimum: 0.0 + title: Iteration + description: Iteration number + prompt: + type: string + minLength: 1 + title: Prompt + description: The attack prompt + techniques: + type: string + title: Techniques + description: Techniques used in the attack + improvement: + type: string + title: Improvement + description: Improvement strategy for next iteration + prompts_objective: + type: string + title: Prompts Objective + description: Objective of the prompt + summary: + type: string + title: Summary + description: Summary of the attack + output: + anyOf: + - type: string + - type: 'null' + title: Output + description: Best target output (highest score) + score: + anyOf: + - + type: integer + maximum: 10.0 + minimum: 0.0 + - type: 'null' + title: Score + description: Best judge score + default: 0 + judge_reasoning: + anyOf: + - type: string + - type: 'null' + title: Judge Reasoning + description: Judge reasoning for best output + threat: + type: boolean + title: Threat + description: Whether this is a threat (score == 3) + default: false + created_at: + anyOf: + - + type: string + format: date-time + - type: 'null' + title: Created At + updated_at: + anyOf: + - + type: string + format: date-time + - type: 'null' + title: Updated At + extra_info: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Extra Info + description: Extra information + version: + anyOf: + - type: integer + - type: 'null' + title: Version + description: Stream Iter data schema version + error: + anyOf: + - type: boolean + - type: 'null' + title: Error + description: Whether this iteration had an error + error_message: + anyOf: + - type: string + - type: 'null' + title: Error Message + description: Error message for this iteration + type: object + required: + - uuid + - tsg_id + - job_id + - stream_id + - goal_id + - iteration + - prompt + - techniques + - improvement + - prompts_objective + - summary + title: StreamIterationDataResponseSchema + description: API response schema for Stream Iteration Data. + StreamIterationDataSchema: + properties: + uuid: type: string format: uuid - title: Job Id - tags: - - Report - /v1/report/static/{job_id}/runtime-policy-config: - get: - summary: Get attack library runtime security profile - description: Get Runtime security profile for a static job. - operationId: get_static_runtime_security_policy_config_v1_report_static__job_id__runtime_policy_config_get - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/RuntimeSecurityProfileResponseSchema' - '422': - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: + title: Uuid + tsg_id: + type: string + title: Tsg Id + job_id: type: string format: uuid title: Job Id - tags: - - Report - /v1/report/dynamic/{job_id}/report: - get: - summary: Get agent scan report - description: Get dynamic job report for a job. - operationId: get_dynamic_job_report_v1_report_dynamic__job_id__report_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/DynamicJobReportSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: + description: Job identifier + stream_id: type: string format: uuid - title: Job Id - tags: - - Report - /v1/report/dynamic/{job_id}/remediation: - get: - summary: Get agent scan rememdiation - description: Get other remediation measures for a dynamic job. - operationId: get_dynamic_remediations_v1_report_dynamic__job_id__remediation_get - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/RemediationResponseSchema' - '422': - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: + title: Stream Id + description: Stream identifier + goal_id: type: string format: uuid - title: Job Id - tags: - - Report - /v1/report/dynamic/{job_id}/runtime-policy-config: - get: - summary: Get agent scan runtime security profile - description: Get Runtime security profile for a dynamic job. - operationId: get_dynamic_runtime_security_policy_config_v1_report_dynamic__job_id__runtime_policy_config_get - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/RuntimeSecurityProfileResponseSchema' - '422': - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: + title: Goal Id + description: Goal identifier + iteration: + type: integer + minimum: 0.0 + title: Iteration + description: Iteration number + prompt: + type: string + minLength: 1 + title: Prompt + description: The attack prompt + prompt_english: + anyOf: + - type: string + - type: 'null' + title: Prompt English + description: English version of prompt for judge + techniques: + type: string + title: Techniques + description: Techniques used in the attack + improvement: + type: string + title: Improvement + description: Improvement strategy for next iteration + prompts_objective: + type: string + title: Prompts Objective + description: Objective of the prompt + summary: + type: string + title: Summary + description: Summary of the attack + output: + anyOf: + - type: string + - type: 'null' + title: Output + description: Best target output (highest score) + output_english: + anyOf: + - type: string + - type: 'null' + title: Output English + description: English version of output for judge + score: + anyOf: + - + type: integer + maximum: 10.0 + minimum: 0.0 + - type: 'null' + title: Score + description: Best judge score + default: 0 + judge_reasoning: + anyOf: + - type: string + - type: 'null' + title: Judge Reasoning + description: Judge reasoning for best output + threat: + type: boolean + title: Threat + description: Whether this is a threat (score == 3) + default: false + created_at: + anyOf: + - + type: string + format: date-time + - type: 'null' + title: Created At + updated_at: + anyOf: + - + type: string + format: date-time + - type: 'null' + title: Updated At + extra_info: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Extra Info + description: Extra information + version: + anyOf: + - type: integer + - type: 'null' + title: Version + description: Stream Iter data schema version + error: + anyOf: + - type: boolean + - type: 'null' + title: Error + description: Whether this iteration had an error + error_message: + anyOf: + - type: string + - type: 'null' + title: Error Message + description: Error message for this iteration + type: object + required: + - uuid + - tsg_id + - job_id + - stream_id + - goal_id + - iteration + - prompt + - techniques + - improvement + - prompts_objective + - summary + title: StreamIterationDataSchema + description: Main stream iteration data - one row per iteration. + StreamListResponseSchema: + properties: + pagination: + $ref: '#/components/schemas/PaginationSchema' + data: + items: + $ref: '#/components/schemas/StreamSchema' + type: array + title: Data + description: List of streams + type: object + required: + - pagination + - data + title: StreamListResponseSchema + description: Response schema for listing attacks following common pagination pattern. + StreamSchema: + properties: + uuid: type: string format: uuid - title: Job Id - tags: - - Report - /v1/report/dynamic/{job_id}/list-goals: - get: - summary: List agent scan goals - description: Get the goals for a job. - operationId: list_dynamic_job_goals_v1_report_dynamic__job_id__list_goals_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/GoalListResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: + title: Uuid + tsg_id: + type: string + title: Tsg Id + job_id: type: string format: uuid title: Job Id - - name: skip - in: query - required: false - schema: + description: Job identifier + target_id: + type: string + format: uuid + title: Target Id + description: Target identifier + stream_idx: type: integer - minimum: 0 - description: Number of goals to skip for pagination + title: Stream Idx + description: Stream index default: 0 - title: Skip - description: Number of goals to skip for pagination - - name: limit - in: query - required: false - schema: + iteration: type: integer - maximum: 100 - minimum: 1 - description: Number of goals to return (1-100) - default: 20 - title: Limit - description: Number of goals to return (1-100) - - name: count - in: query - required: false - schema: + title: Iteration + description: Iteration + default: 0 + goal_id: + type: string + format: uuid + title: Goal Id + description: Goal identifier + goal: + anyOf: + - $ref: '#/components/schemas/GoalSchema' + - type: string + - type: 'null' + title: Goal + description: Goal to use in the backend + marked_safe: type: boolean - description: Include total count of goals + title: Marked Safe + description: Marked safe + default: false + stream_type: + anyOf: + - $ref: '#/components/schemas/StreamType' + - type: 'null' + default: NORMAL + threat: + type: boolean + title: Threat + description: Indicates if it is a threat + default: false + first_threat_iteration: + anyOf: + - $ref: '#/components/schemas/StreamIterationDataSchema' + - type: 'null' + description: First threat iteration data (denormalized JSONB for performance) + created_at: + anyOf: + - + type: string + format: date-time + - type: 'null' + title: Created At + updated_at: + anyOf: + - + type: string + format: date-time + - type: 'null' + title: Updated At + extra_info: + additionalProperties: true + type: object + title: Extra Info + description: Extra information + version: + anyOf: + - type: integer + - type: 'null' + title: Version + description: Stream schema version + error: + anyOf: + - type: boolean + - type: 'null' + title: Error + description: Whether this stream encountered errors + error_message: + anyOf: + - type: string + - type: 'null' + title: Error Message + description: Error message details + type: object + required: + - uuid + - tsg_id + - job_id + - target_id + - goal_id + title: StreamSchema + StreamType: + type: string + enum: + - NORMAL + - ADVERSARIAL + title: StreamType + SubCategoryModel: + properties: + id: + type: string + title: Id + description: Unique identifier + display_name: + type: string + title: Display Name + description: Frontend display name + description: + type: string + title: Description + description: Description + preselect: + type: boolean + title: Preselect + description: Whether this subcategory should be preselected in UI default: true - title: Count - description: Include total count of goals - - name: status - in: query - required: false - schema: + prerequisites: + anyOf: + - + items: + $ref: '#/components/schemas/PrerequisiteModel' + type: array + - type: 'null' + title: Prerequisites + description: List of prerequisites for this subcategory + active: + type: boolean + title: Active + description: Whether this subcategory is active + default: true + type: object + required: + - id + - display_name + - description + title: SubCategoryModel + description: Pydantic model for subcategory data + SubCategoryStatsSchema: + properties: + id: + type: string + title: Id + description: Unique identifier + display_name: + type: string + title: Display Name + description: Frontend display name + description: + type: string + title: Description + description: Description + preselect: + type: boolean + title: Preselect + description: Whether this subcategory should be preselected in UI + default: true + prerequisites: + anyOf: + - + items: + $ref: '#/components/schemas/PrerequisiteModel' + type: array + - type: 'null' + title: Prerequisites + description: List of prerequisites for this subcategory + active: + type: boolean + title: Active + description: Whether this subcategory is active + default: true + successful: + type: integer + title: Successful + description: Number of successful attacks (threat=True) + failed: + type: integer + title: Failed + description: Number of failed attacks (threat=False) + total: + type: integer + title: Total + description: Total attacks for this subcategory (successful + failed) + default: 0 + type: object + required: + - id + - display_name + - description + - successful + - failed + title: SubCategoryStatsSchema + description: Statistics for a specific subcategory. + TargetAdditionalContext: + properties: + base_model: + anyOf: + - type: string + - type: 'null' + title: Base Model + description: 'Base model name (e.g., GPT-4, Claude)' + core_architecture: + anyOf: + - type: string + - type: 'null' + title: Core Architecture + description: Core architecture details + system_prompt: + anyOf: + - type: string + - type: 'null' + title: System Prompt + description: System prompt + languages_supported: + anyOf: + - + items: + type: string + type: array + - type: 'null' + title: Languages Supported + description: Supported languages + banned_keywords: + anyOf: + - + items: + type: string + type: array + - type: 'null' + title: Banned Keywords + description: Banned keywords/phrases + tools_accessible: + anyOf: + - + items: + type: string + type: array + - type: 'null' + title: Tools Accessible + description: Accessible tools/capabilities + type: object + title: TargetAdditionalContext + description: | + Additional context - used in create/update API requests and stored in DB/GCS. + + Single value fields are strings. + List fields are lists of strings. + TargetBackground: + properties: + industry: anyOf: - - $ref: '#/components/schemas/StatusQueryParam' + - type: string - type: 'null' - description: Filter by status - title: Status - description: Filter by status - - name: goal_type - in: query - required: false - schema: + title: Industry + description: 'Target''s industry (e.g., Healthcare, Finance)' + use_case: anyOf: - - $ref: '#/components/schemas/GoalTypeQueryParam' + - type: string - type: 'null' - description: Filter by goal type - title: Goal Type - description: Filter by goal type - - name: search - in: query - required: false - schema: + title: Use Case + description: 'Primary use case (e.g., Customer Support, Code Assistant)' + competitors: anyOf: - - type: string + - + items: + type: string + type: array - type: 'null' - description: Search string to filter goals - title: Search - description: Search string to filter goals - tags: - - Report - /v1/report/dynamic/{job_id}/goal/{goal_id}/list-streams: - get: - summary: List agent scan goal deatils - description: Get streams for a specific goal in a job. - operationId: list_dynamic_job_streams_v1_report_dynamic__job_id__goal__goal_id__list_streams_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/StreamListResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: - type: string - format: uuid - title: Job Id - - name: goal_id - in: path - required: true - schema: - type: string - format: uuid - title: Goal Id - tags: - - Report - /v1/report/dynamic/stream/{stream_id}: - get: - summary: List agent scan stream details - description: Retrieve the {stream id} details through this Application Programming - Interface endpoint. - operationId: get_stream_detail_v1_report_dynamic_stream__stream_id__get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/StreamDetailResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: stream_id - in: path - required: true - schema: - type: string - format: uuid - title: Stream Id - tags: - - Report - /v1/report/{job_id}/download: - get: - summary: Download report - description: Download report files for a job. - operationId: download_report_v1_report__job_id__download_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: {} - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: - type: string - format: uuid - title: Job Id - - name: file_format - in: query - required: true - schema: - $ref: '#/components/schemas/FileFormat' - description: Format of the report file (CSV, JSON, or ALL) - description: Format of the report file (CSV, JSON, or ALL) - tags: - - Report - /v1/report/{job_id}/generate-partial-report: - post: - summary: Generate partial scan report - description: 'Unlock a partial report by consuming a quota credit. This endpoint: - - Validates the job is PARTIALLY_COMPLETE - Consumes 1 quota credit of the - job type - Unlocks the report for viewing **Returns:** - Updated job information - with unlocked report.' - operationId: generate_partial_job_report_v1_report__job_id__generate_partial_report_post - responses: - 200: - description: Successful Response - content: - application/json: - schema: {} - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: - type: string - format: uuid - title: Job Id - tags: - - Report - /v1/report/static/{job_id}/attack-multi-turn/{attack_id}: - get: - summary: Get multi-turn attack details - description: Get detailed multi-turn attack information including outputs and - framework techniques. - operationId: get_attack_multi_turn_detail_v1_report_static__job_id__attack_multi_turn__attack_id__get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/AttackMultiTurnDetailResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: - type: string - format: uuid - title: Job Id - - name: attack_id - in: path - required: true - schema: - type: string - format: uuid - title: Attack Id - tags: - - Report - /v1/metering/quota: - post: - summary: Get quota summary - description: Get aggregated quota summary for the current TSG (POST endpoint - for backward compatibility). - operationId: post_quota_summary_v1_metering_quota_post - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/QuotaSummarySchema' - 401: - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: [] - tags: - - Quota - /v1/custom-attacks/report/{job_id}: - get: - summary: Get custom attack Report - description: Get comprehensive custom attack report. - operationId: get_custom_attack_report_v1_custom_attacks_report__job_id__get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/CustomAttackReportResponse' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: - type: string - format: uuid - title: Job Id - tags: - - CustomAttack - /v1/custom-attacks/report/{job_id}/prompt-sets: - get: - summary: Get prompt sets - description: Get prompt sets with filtering and pagination. - operationId: get_prompt_sets_v1_custom_attacks_report__job_id__prompt_sets_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/PromptSetsReportResponse' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: + title: Competitors + description: Known competitor products + agentic_profiling_enabled: + type: boolean + title: Agentic Profiling Enabled + description: Whether agentic profiling is enabled for this target + default: true + type: object + title: TargetBackground + description: | + Target background - used in create/update API requests and stored in DB/GCS. + + Required fields for activation: + - industry (string, required) + - use_case (string, required) + + Optional field: + - competitors (list of strings) + TargetConnectionType: + type: string + enum: + - DATABRICKS + - BEDROCK + - OPENAI + - HUGGING_FACE + - CUSTOM + - REST + - STREAMING + - WEBSOCKET + - WEBSOCKET_STREAMING + - MS_COPILOT_STUDIO + title: TargetConnectionType + description: Connection type/provider for the target. + TargetJobRequest: + properties: + uuid: type: string format: uuid - title: Job Id - - name: property_filters - in: query - required: false - schema: + title: Uuid + description: Target UUID + version: + anyOf: + - type: integer + - type: 'null' + title: Version + description: Target configuration version + type: object + required: + - uuid + title: TargetJobRequest + description: Enhanced request schema for targeting specific targets. + TargetMetadata: + properties: + multi_turn: + type: boolean + title: Multi Turn + description: Whether target supports multi-turn conversations (Probe 2 result) + default: false + multi_turn_error_message: anyOf: - type: string - type: 'null' - description: JSON string of property filters - title: Property Filters - description: JSON string of property filters - - name: is_threat - in: query - required: false - schema: + title: Multi Turn Error Message + description: Concise error message if Probe 2 failed + examples: + - Session ID extraction failed + - Assistant role not configured + rate_limit: anyOf: - - type: boolean + - type: integer - type: 'null' - description: Filter by threat status - title: Is Threat - description: Filter by threat status - - name: skip - in: query - required: false - schema: - type: integer - minimum: 0 - description: Number of records to skip - default: 0 - title: Skip - description: Number of records to skip - - name: limit - in: query - required: false - schema: - type: integer - maximum: 100 - minimum: 1 - description: Maximum number of records to return - default: 20 - title: Limit - description: Maximum number of records to return - tags: - - CustomAttack - /v1/custom-attacks/report/{job_id}/prompt-set/{prompt_set_id}/prompts: - get: - summary: Get prompts by set - description: Get prompts for a specific prompt set with pagination. - operationId: get_prompts_by_set_v1_custom_attacks_report__job_id__prompt_set__prompt_set_id__prompts_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/PromptDetailResponse' - title: Response Get Prompts By Set V1 Custom Attacks Report Job Id Prompt - Set Prompt Set Id Prompts Get - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: - type: string - format: uuid - title: Job Id - - name: prompt_set_id - in: path - required: true - schema: - type: string - format: uuid - title: Prompt Set Id - - name: is_threat - in: query - required: false - schema: + title: Rate Limit + description: Current rate limit value + examples: + - 996 + rate_limit_enabled: + type: boolean + title: Rate Limit Enabled + description: Whether rate limiting is enabled + default: false + rate_limit_error_code: anyOf: - - type: boolean + - type: integer - type: 'null' - description: Filter by threat status - title: Is Threat - description: Filter by threat status - - name: skip - in: query - required: false - schema: - type: integer - minimum: 0 - description: Number of records to skip - default: 0 - title: Skip - description: Number of records to skip - - name: limit - in: query - required: false - schema: - type: integer - maximum: 100 - minimum: 1 - description: Maximum number of records to return - default: 20 - title: Limit - description: Maximum number of records to return - tags: - - CustomAttack - /v1/custom-attacks/report/{job_id}/prompt/{prompt_id}: - get: - summary: Get prompt details - description: Get detailed information for a specific prompt. - operationId: get_prompt_detail_v1_custom_attacks_report__job_id__prompt__prompt_id__get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/PromptDetailResponse' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: - type: string - format: uuid - title: Job Id - - name: prompt_id - in: path - required: true - schema: - type: string - format: uuid - title: Prompt Id - tags: - - CustomAttack - /v1/custom-attacks/job/{job_id}/list-custom-attacks: - get: - summary: List custom attacks - description: List custom attacks with V2 features. - operationId: list_custom_attacks_v1_custom_attacks_job__job_id__list_custom_attacks_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/CustomAttacksListResponse' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: - type: string - format: uuid - title: Job Id - - name: skip - in: query - required: false - schema: - type: integer - minimum: 0 - description: Number of records to skip - default: 0 - title: Skip - description: Number of records to skip - - name: limit - in: query - required: false - schema: - type: integer - maximum: 1000 - minimum: 1 - description: Maximum number of records to return - default: 100 - title: Limit - description: Maximum number of records to return - - name: threat - in: query - required: false - schema: + title: Rate Limit Error Code + description: HTTP status code for rate limit errors + examples: + - 429 + rate_limit_error_json: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Rate Limit Error Json + description: JSON structure of rate limit error response + examples: + - error: + code: rate_limit_exceeded + message: 'Rate limit reached for o1-preview on requests per min (RPM): Limit 20, Used 20, Requested 1. Please try again in 3s. Visit https://platform.openai.com/account/rate-limits to learn more.' + param: 'null' + type: requests + rate_limit_error_message: + anyOf: + - type: string + - type: 'null' + title: Rate Limit Error Message + description: Raw error message string for rate limit errors + examples: + - 'Rate limit reached for o1-preview on requests per min (RPM): Limit 20, Used 20, Requested 1. Please try again in 3s.' + content_filter_enabled: + type: boolean + title: Content Filter Enabled + description: Whether content filtering is enabled + default: false + content_filter_error_code: anyOf: - - type: boolean + - type: integer - type: 'null' - description: 'Filter by threat status: true for successful attacks, false - for failed attacks' - title: Threat - description: 'Filter by threat status: true for successful attacks, false - for failed attacks' - - name: prompt_set_id - in: query - required: false - schema: + title: Content Filter Error Code + description: HTTP status code for content filter errors + examples: + - 400 + content_filter_error_json: anyOf: - - type: string + - + additionalProperties: true + type: object - type: 'null' - description: Filter by prompt set ID - title: Prompt Set Id - description: Filter by prompt set ID - - name: property_value - in: query - required: false - schema: + title: Content Filter Error Json + description: JSON structure of content filter error response + examples: + - error: + code: invalid_prompt + message: 'Invalid prompt: your prompt was flagged as potentially violating our usage policy. Please try again with a different prompt.' + type: invalid_request_error + content_filter_error_message: anyOf: - type: string - type: 'null' - description: JSON string of property filters - title: Property Value - description: JSON string of property filters - tags: - - CustomAttack - /v1/custom-attacks/job/{job_id}/attack/{attack_id}/list-outputs: - get: - summary: Get attack outputs - description: Get outputs for a specific attack. - operationId: get_attack_outputs_v1_custom_attacks_job__job_id__attack__attack_id__list_outputs_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/CustomAttackOutputSchema' - title: Response Get Attack Outputs V1 Custom Attacks Job Job Id Attack Attack - Id List Outputs Get - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: - type: string - format: uuid - title: Job Id - - name: attack_id - in: path - required: true - schema: + title: Content Filter Error Message + description: Raw error message string for content filter errors + examples: + - 'Invalid prompt: your prompt was flagged as potentially violating our usage policy. Please try again with a different prompt.' + probe_message: type: string - format: uuid - title: Attack Id - tags: - - CustomAttack - /v1/custom-attacks/job/{job_id}/property-stats: - get: - summary: Get property stats - description: Get property-based statistics for custom attacks. - operationId: get_property_stats_v1_custom_attacks_job__job_id__property_stats_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - type: array - items: - type: object - additionalProperties: true - title: Response Get Property Stats V1 Custom Attacks Job Job Id Property - Stats Get - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: + title: Probe Message + default: 'Hello, this is a test message from the red team validation system.' + request_timeout: + type: number + title: Request Timeout + description: Request timeout in seconds + default: 110 + examples: + - 110 + type: object + title: TargetMetadata + description: Metadata stored in the database for targets (user-provided + computed fields). + TargetReferenceSchema: + properties: + uuid: type: string format: uuid - title: Job Id - tags: - - CustomAttack - /v1/error-log/job/{job_id}: - get: - summary: List error logs for a scan - description: List error logs for a specific job. - operationId: list_error_logs_for_job_v1_error_log_job__job_id__get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorLogListResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: + title: Uuid + tsg_id: type: string - format: uuid - title: Job Id - - name: limit - in: query - required: false - schema: - type: integer - maximum: 100 - minimum: 1 - description: Number of attacks to return (1-100) - default: 5 - title: Limit - description: Number of attacks to return (1-100) - - name: skip - in: query - required: false - schema: - type: integer - minimum: 0 - description: Number of attacks to skip for pagination - default: 0 - title: Skip - description: Number of attacks to skip for pagination - tags: - - ErrorLogs - /v1/dashboard/scan-statistics: - get: - summary: Get scan statistics and risk profile - description: Returns scan counts, target statistics, status breakdown, and risk - profile for dashboard display. - operationId: get_scan_statistics_v1_dashboard_scan_statistics_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/ScanStatisticsResponseSchema' - 401: - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: [] - tags: - - Dashboard - /v1/dashboard/score-trend: - get: - summary: Get score trend for a target - description: Returns time-series risk scores grouped by job type for chart display. - operationId: get_score_trend_v1_dashboard_score_trend_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/ScoreTrendResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: target_id - in: query - required: true - schema: + title: Tsg Id + name: type: string - format: uuid - description: Target UUID to fetch scores for - title: Target Id - description: Target UUID to fetch scores for - - name: date_range - in: query - required: false - schema: - $ref: '#/components/schemas/DateRangeFilter' - description: Predefined date range filter - default: LAST_7_DAYS - description: Predefined date range filter - - name: start_date - in: query - required: false - schema: + title: Name + description: Target name + examples: + - GPT 4.1 Nano + description: + anyOf: + - type: string + - type: 'null' + title: Description + description: Optional target description + default: + examples: + - AI model for testing + target_type: + anyOf: + - $ref: '#/components/schemas/TargetType' + - type: 'null' + description: Type of target + connection_type: + anyOf: + - $ref: '#/components/schemas/TargetConnectionType' + - type: 'null' + description: Connection type/provider for the target + examples: + - CUSTOM + - OPENAI + - BEDROCK + api_endpoint_type: + anyOf: + - $ref: '#/components/schemas/ApiEndpointType' + - type: 'null' + description: Accessibility type of the API endpoint + examples: + - PUBLIC + - PRIVATE + - NETWORK_BROKER + response_mode: + anyOf: + - $ref: '#/components/schemas/ResponseMode' + - type: 'null' + description: Response mode for API interactions + examples: + - REST + - STREAMING + - WEBSOCKET + auth_type: + anyOf: + - $ref: '#/components/schemas/AuthType' + - type: 'null' + description: Authentication method for target API access + examples: + - HEADERS + - BASIC_AUTH + - OAUTH2 + session_supported: + type: boolean + title: Session Supported + description: Whether target supports session for multi-turn conversations + default: false + extra_info: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Extra Info + description: Additional configuration or metadata for the target + default: {} + examples: + - custom_key: custom_value + status: + $ref: '#/components/schemas/TargetStatus' + description: Target status + active: + type: boolean + title: Active + description: Whether target is active + validated: + type: boolean + title: Validated + description: Whether target is validated + version: + anyOf: + - type: integer + - type: 'null' + title: Version + description: Configuration version + secret_version: anyOf: - type: string - format: date - type: 'null' - description: Custom start date (overrides date_range if both provided) - title: Start Date - description: Custom start date (overrides date_range if both provided) - - name: end_date - in: query - required: false - schema: + title: Secret Version + description: 'Secret Manager version for connection_params. When present, sensitive connection data is stored in Secret Manager. When None, connection_params are stored in GCS (legacy).' + created_by_user_id: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Created By User Id + description: User ID of target creator + updated_by_user_id: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Updated By User Id + description: User ID of last target updater + created_at: + type: string + format: date-time + title: Created At + description: Creation timestamp + updated_at: + type: string + format: date-time + title: Updated At + description: Last update timestamp + profiling_status: + anyOf: + - $ref: '#/components/schemas/ProfilingStatus' + - type: 'null' + description: Status of the profiling workflow + canonical_id: anyOf: - type: string - format: date - type: 'null' - description: Custom end date (overrides date_range if both provided) - title: End Date - description: Custom end date (overrides date_range if both provided) - tags: - - Dashboard - /v1/sentiment: - post: - summary: Update sentiment scan report - description: Create or update sentiment for a job report. - operationId: create_or_update_sentiment_v1_sentiment_post - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/SentimentResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: [] - tags: - - Sentiment - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SentimentRequestSchema' - required: true - /v1/sentiment/{job_id}: - get: - summary: Get sentiment for a scan report + title: Canonical Id + description: Partner-supplied stable identifier. Null for targets without partner integration metadata (most targets). + target_metadata: + $ref: '#/components/schemas/TargetMetadata' + description: Target metadata and configuration options + target_background: + anyOf: + - $ref: '#/components/schemas/TargetBackground' + - type: 'null' + description: 'Target background info: industry, use_case, competitors' + profiling_progress: + anyOf: + - type: integer + - type: 'null' + title: Profiling Progress + description: Profiling progress percentage (0–100) + additional_context: + anyOf: + - $ref: '#/components/schemas/TargetAdditionalContext' + - type: 'null' + description: Additional context with source tracking (user + profiler) + type: object + required: + - uuid + - tsg_id + - name + - status + - active + - validated + - created_at + - updated_at + title: TargetReferenceSchema + TargetStatus: + type: string + enum: + - DRAFT + - VALIDATING + - VALIDATED + - ACTIVE + - INACTIVE + - FAILED + - PENDING_AUTH + title: TargetStatus + description: Status enumeration for scan targets. + TargetType: + type: string + enum: + - APPLICATION + - AGENT + - MODEL + title: TargetType + description: Target Types Available + TechniqueModel: + properties: + id: + type: string + title: Id + description: Technique unique identifier + display_name: + type: string + title: Display Name + description: Technique display name for frontend + compliance_id: + type: string + title: Compliance Id + description: Associated compliance framework ID + description: + type: string + title: Description + description: Technique description + link: + type: string + title: Link + description: Technique documentation link + version: + type: string + title: Version + description: Technique version + active: + type: boolean + title: Active + description: Whether technique is active + type: object + required: + - id + - display_name + - compliance_id + - description + - link + - version + - active + title: TechniqueModel + description: Pydantic model for technique data + TenantLanguagesResponseSchema: + properties: + multilingual_enabled: + type: boolean + title: Multilingual Enabled + supported_job_types: + items: + type: string + type: array + title: Supported Job Types + languages: + items: + $ref: '#/components/schemas/LanguageOptionSchema' + type: array + title: Languages + type: object + required: + - multilingual_enabled + - supported_job_types + - languages + title: TenantLanguagesResponseSchema + description: Response for GET /v1/languages — tenant-facing language dropdown. + ToxicContentGuardrailSchema: + properties: + moderate: + $ref: '#/components/schemas/GuardrailAction' + description: 'Action for moderate toxicity: ''allow'', ''block''' + default: BLOCK + high: + $ref: '#/components/schemas/GuardrailAction' + description: 'Action for high toxicity: ''allow'', ''block''' + default: BLOCK + type: object + title: ToxicContentGuardrailSchema description: Guardrail configuration for toxic content with severity levels. - operationId: get_job_sentiment_v1_sentiment__job_id__get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/SentimentResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: job_id - in: path - required: true - schema: + ValidationError: + properties: + loc: + items: + anyOf: + - type: string + - type: integer + type: array + title: Location + msg: type: string - format: uuid - title: Job Id - tags: - - Sentiment + title: Message + type: + type: string + title: Error Type + type: object + required: + - loc + - msg + - type + title: ValidationError \ No newline at end of file diff --git a/specs/PaloAltoNetworks-AIRS-RedTeam-management.yaml b/specs/PaloAltoNetworks-AIRS-RedTeam-management.yaml index 4ff265f..cd9a5d0 100644 --- a/specs/PaloAltoNetworks-AIRS-RedTeam-management.yaml +++ b/specs/PaloAltoNetworks-AIRS-RedTeam-management.yaml @@ -1,4081 +1,5634 @@ openapi: 3.1.0 info: title: Prisma AIRS Red Teaming Management API - version: 0.5.20 - description: "Red Teaming Management API - Configure and manage security groups\ - \ and rules for AI/ML model scanning. \xA9 2025 Palo Alto Networks, Inc This Open\ - \ API spec file was created on February 25, 2026. \xA9 2026 Palo Alto Networks,\ - \ Inc. Palo Alto Networks is a registered trademark of Palo Alto Networks. A list\ - \ of our trademarks can be found at [https://www.paloaltonetworks.com/company/trademarks.html](https://www.paloaltonetworks.com/company/trademarks.html).\ - \ All other marks mentioned herein may be trademarks of their respective companies." + description: 'Red Teaming Management API - Configure and manage security groups and rules for AI/ML model scanning.' + version: 0.6.88 + termsOfService: https://www.paloaltonetworks.com/content/dam/pan/en_US/assets/pdf/legal/palo-alto-networks-end-user-license-agreement-eula.pdf + license: + name: MIT + url: https://opensource.org/license/mit + contact: + email: support@paloaltonetworks.com + name: Palo Alto Networks Technical Support + url: https://support.paloaltonetworks.com servers: - url: https://api.sase.paloaltonetworks.com/ai-red-teaming/mgmt-plane security: -- bearerAuth: [] -components: - securitySchemes: - bearerAuth: - type: http - scheme: bearer - bearerFormat: JWT - schemas: - ApiEndpointType: - type: string - enum: - - PUBLIC - - PRIVATE - - NETWORK_BROKER - title: ApiEndpointType - description: API endpoint accessibility type. - AuthType: - type: string - enum: - - OAUTH - - ACCESS_TOKEN - title: AuthType - BaseResponseSchema: - properties: - message: - type: string - title: Message - description: Response message - status: + - bearerAuth: [] + +tags: + - name: CustomAttack + description: Operations for managing custom prompt sets, prompts, and properties. + - name: Dashboard + description: Operations for retrieving dashboard overview and statistics. + - name: Languages + description: List Languages + - name: Target + description: Operations for managing scan targets (create, update, delete, list). + +paths: + /v1/target: + post: + tags: + - Target + summary: Create target + description: Create a new scan target. + operationId: create_target_v1_target_post + parameters: + - + name: validate + in: query + required: false + schema: + type: boolean + description: Whether to validate target configuration + examples: + - true + title: Validate + description: Whether to validate target configuration + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TargetCreateRequestSchema' + responses: + 201: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/TargetResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + get: + tags: + - Target + summary: List targets + description: List all scan targets with pagination and filtering support. + operationId: list_targets_v1_target_get + parameters: + - + name: skip + in: query + required: false + schema: type: integer - title: Status - description: HTTP status code - type: object - required: - - message - - status - title: BaseResponseSchema - description: Standard response schema for simple operations like create, update, - delete. - BedrockAccessConnectionParams: - properties: - access_id: - type: string - title: Access Id - description: AWS access key ID - access_secret: - type: string - title: Access Secret - description: AWS secret access key - session_token: + minimum: 0 + description: Number of records to skip + default: 0 + title: Skip + description: Number of records to skip + - + name: limit + in: query + required: false + schema: + type: integer + maximum: 100 + minimum: 1 + description: Maximum records to return + default: 10 + title: Limit + description: Maximum records to return + - + name: target_type + in: query + required: false + schema: anyOf: - - type: string + - $ref: '#/components/schemas/TargetType' - type: 'null' - title: Session Token - description: AWS session token (optional) - region: - type: string - title: Region - description: AWS region - model_id: - type: string - title: Model Id - description: Bedrock model ID - type: object - required: - - access_id - - access_secret - - region - - model_id - title: BedrockAccessConnectionParams - description: AWS Bedrock access parameters stored in target_metadata. - BedrockAccessConnectionRedactParams: - properties: - access_id: - type: string - format: password - title: Access Id - description: AWS access key ID - writeOnly: true - access_secret: - type: string - format: password - title: Access Secret - description: AWS secret access key - writeOnly: true - session_token: + description: Filter by target type + title: Target Type + description: Filter by target type + - + name: status + in: query + required: false + schema: anyOf: - - type: string - format: password - writeOnly: true + - $ref: '#/components/schemas/TargetStatusFilter' - type: 'null' - title: Session Token - description: AWS session token (optional) - region: - type: string - title: Region - description: AWS region - model_id: - type: string - title: Model Id - description: Bedrock model ID - type: object - required: - - access_id - - access_secret - - region - - model_id - title: BedrockAccessConnectionRedactParams - description: AWS Bedrock access parameters stored in target_metadata. - Body_upload_prompts_csv_v1_custom_attack_upload_custom_prompts_csv_post: - properties: - file: - type: string - format: binary - title: File - type: object - required: - - file - title: Body_upload_prompts_csv_v1_custom_attack_upload_custom_prompts_csv_post - CountByNameSchema: - properties: - name: - type: string - title: Name - description: Name of the item (e.g., target type, status) - count: - type: integer - minimum: 0.0 - title: Count - description: Count of items - type: object - required: - - name - - count - title: CountByNameSchema - description: 'Generic count schema with name field for extensible list structures. - - - Used in dashboard and other endpoints to provide counts grouped by a name - field. - - Frontend-friendly list format for easy iteration. - - ' - CustomPromptCreateRequestSchema: - properties: - prompt: - type: string - title: Prompt - description: The prompt text - goal: + description: Filter by target status or profiling status + title: Status + description: Filter by target status or profiling status + - + name: search + in: query + required: false + schema: anyOf: - type: string - type: 'null' - title: Goal - description: Goal of the prompt (user-defined or AI-generated) - properties: - additionalProperties: - type: string - type: object - title: Properties - description: Property assignments (property_name -> property_value) - prompt_set_id: + description: Search target by name + title: Search + description: Search target by name + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/TargetListSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/target/{target_uuid}: + get: + tags: + - Target + summary: Get target details + description: Retrieve a specific target by UUID with complete configuration details and masked connection parameters. + operationId: get_target_v1_target__target_uuid__get + parameters: + - + name: target_uuid + in: path + required: true + schema: type: string format: uuid - title: Prompt Set Id - description: The UUID of the prompt set - additionalProperties: false - type: object - required: - - prompt - - prompt_set_id - title: CustomPromptCreateRequestSchema - description: Schema for creating a new custom prompt. - CustomPromptListItemSchema: - properties: - uuid: + title: Target Uuid + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/TargetRedactSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + put: + tags: + - Target + summary: Update target + description: Update an existing target with new configuration and optional validation control. + operationId: update_target_v1_target__target_uuid__put + parameters: + - + name: target_uuid + in: path + required: true + schema: type: string format: uuid - title: Uuid - description: Unique identifier - prompt: - type: string - title: Prompt - description: The prompt text - goal: - anyOf: - - type: string - - type: 'null' - title: Goal - description: Goal of the prompt - user_defined_goal: - type: boolean - title: User Defined Goal - description: Whether the goal was user-defined - status: - type: string - title: Status - description: Status of the prompt - active: + title: Target Uuid + - + name: validate + in: query + required: false + schema: type: boolean - title: Active - description: Whether the prompt is active - properties: - additionalProperties: - type: string - type: object - title: Properties - description: Property assignments - created_at: - type: string - format: date-time - title: Created At - description: Creation timestamp - updated_at: - type: string - format: date-time - title: Updated At - description: Last update timestamp - type: object - required: - - uuid - - prompt - - user_defined_goal - - status - - active - - created_at - - updated_at - title: CustomPromptListItemSchema - description: Schema for custom prompt items in list responses. - CustomPromptListSchema: - properties: - pagination: - $ref: '#/components/schemas/PaginationSchema' - data: - items: - $ref: '#/components/schemas/CustomPromptListItemSchema' - type: array - title: Data - description: List of custom prompts - type: object - required: - - pagination - title: CustomPromptListSchema - description: Schema for custom prompt list responses. - CustomPromptResponseSchema: - properties: - uuid: + description: Whether to validate target configuration + default: true + title: Validate + description: Whether to validate target configuration + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TargetUpdateRequestSchema' + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/TargetSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + delete: + tags: + - Target + summary: Delete target + description: Permanently delete a target and its encrypted configuration data. + operationId: delete_target_v1_target__target_uuid__delete + parameters: + - + name: target_uuid + in: path + required: true + schema: type: string format: uuid - title: Uuid - description: Unique identifier - prompt: + title: Target Uuid + responses: + 204: + description: Successful Response + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/target/{target_uuid}/profile: + post: + tags: + - Target + summary: Start target profiling + description: Manually trigger target profiling. Target must be active with industry and use_case. + operationId: start_profiling_v1_target__target_uuid__profile_post + parameters: + - + name: target_uuid + in: path + required: true + schema: type: string - title: Prompt - description: The prompt text - goal: - anyOf: - - type: string - - type: 'null' - title: Goal - description: Goal of the prompt - user_defined_goal: - type: boolean - title: User Defined Goal - description: Whether the goal was user-defined - detector_category: - anyOf: - - type: string - - type: 'null' - title: Detector Category - description: Detector category - severity: - anyOf: - - type: string - - type: 'null' - title: Severity - description: Severity level - status: + format: uuid + title: Target Uuid + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/StartProfilingResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + put: + tags: + - Target + summary: Update target profile + description: Update target background and additional context fields without connection validation. + operationId: update_target_profile_v1_target__target_uuid__profile_put + parameters: + - + name: target_uuid + in: path + required: true + schema: type: string - title: Status - description: Status of the prompt - active: - type: boolean - title: Active - description: Whether the prompt is active - extra_info: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Extra Info - description: Additional information - prompt_set_id: + format: uuid + title: Target Uuid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TargetContextUpdateSchema' + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/TargetSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + get: + tags: + - Target + summary: Get profiling results + description: Get profiling results including merged user and profiler data. + operationId: get_profiling_results_v1_target__target_uuid__profile_get + parameters: + - + name: target_uuid + in: path + required: true + schema: type: string format: uuid - title: Prompt Set Id - description: The UUID of the prompt set this prompt belongs to - properties: - additionalProperties: - type: string - type: object - title: Properties - description: Property assignments - property_assignments: - items: - $ref: '#/components/schemas/PropertyAssignmentSchema' - type: array - title: Property Assignments - description: Detailed property assignments - created_at: - type: string - format: date-time - title: Created At - description: Creation timestamp - updated_at: - type: string - format: date-time - title: Updated At - description: Last update timestamp - type: object - required: - - uuid - - prompt - - user_defined_goal - - status - - active - - prompt_set_id - - created_at - - updated_at - title: CustomPromptResponseSchema - description: Schema for custom prompt responses. - CustomPromptSetArchiveRequestSchema: - properties: - archive: - type: boolean - title: Archive - description: True to archive, False to unarchive - additionalProperties: false - type: object - required: - - archive - title: CustomPromptSetArchiveRequestSchema - description: Schema for archiving/unarchiving prompt sets. - CustomPromptSetCreateRequestSchema: - properties: - name: - type: string - maxLength: 255 - title: Name - description: Name of the custom prompt set - description: - anyOf: - - type: string - - type: 'null' - title: Description - description: Description of the custom prompt set - default: null - property_names: - items: - type: string - type: array - maxItems: 2 - title: Property Names - description: Property names for this prompt set (max 2) - additionalProperties: false - type: object - required: - - name - title: CustomPromptSetCreateRequestSchema - description: Schema for creating a new custom prompt set. - CustomPromptSetListActiveSchema: - properties: - data: - items: - $ref: '#/components/schemas/CustomPromptSetReferenceSchema' - type: array - title: Data - description: List of active custom prompt set references - type: object - title: CustomPromptSetListActiveSchema - description: 'Schema for listing active custom prompt sets available for use. - - - Used by data plane to discover available prompt sets for job creation. - - ' - CustomPromptSetListItemSchema: - properties: - uuid: + title: Target Uuid + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/TargetProfileResponse' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/target/probe: + post: + tags: + - Target + summary: Run profiling probes on target + description: Send profiling questions to a target using provided connection parameters. Returns TargetResponseSchema with target_background and additional_context populated from probe responses. + operationId: run_target_probes_v1_target_probe_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TargetProbeRequest' + required: true + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/TargetResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/target/validate-auth: + post: + tags: + - Target + summary: Validate authentication configuration + description: 'Validate OAuth2 credentials by fetching a test token. For HEADERS and BASIC_AUTH, validates field presence only.' + operationId: validate_auth_v1_target_validate_auth_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TargetAuthValidationRequestSchema' + required: true + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/TargetAuthValidationResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/target/ms-copilot-studio/auth-url: + post: + tags: + - Target + summary: Generate Copilot Studio auth URL + description: Generate MS Copilot Studio OAuth authorization URL. + operationId: generate_ms_copilot_studio_auth_url_v1_target_ms_copilot_studio_auth_url_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MSCopilotStudioAuthUrlRequestSchema' + required: true + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/MSCopilotStudioAuthUrlResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/target/ms-copilot-studio/token: + post: + tags: + - Target + summary: Exchange Copilot Studio auth code + description: 'Exchange auth code for tokens via MSAL, store token cache in GSM.' + operationId: exchange_ms_copilot_studio_token_v1_target_ms_copilot_studio_token_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MSCopilotStudioTokenRequestSchema' + required: true + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/MSCopilotStudioTokenResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/target/ms-copilot-studio/token/{token_json_uuid}: + delete: + tags: + - Target + summary: Delete MS Copilot Studio token records + description: Delete both auth flow and token cache GSM records (cancel cleanup). + operationId: delete_ms_copilot_studio_token_v1_target_ms_copilot_studio_token__token_json_uuid__delete + parameters: + - + name: token_json_uuid + in: path + required: true + schema: type: string format: uuid - title: Uuid - description: Unique identifier - name: - type: string - title: Name - description: Name of the prompt set - description: + title: Token Json Uuid + responses: + 204: + description: Successful Response + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attack/custom-prompt-set: + post: + tags: + - CustomAttack + summary: Create a new custom prompt set + description: Create a new custom prompt set. + operationId: create_prompt_set_v1_custom_attack_custom_prompt_set_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CustomPromptSetCreateRequestSchema' + required: true + responses: + 201: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomPromptSetResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attack/list-custom-prompt-sets: + get: + tags: + - CustomAttack + summary: List custom prompt sets + description: List all custom prompt sets with pagination and filtering support. + operationId: list_prompt_sets_v1_custom_attack_list_custom_prompt_sets_get + parameters: + - + name: skip + in: query + required: false + schema: + type: integer + minimum: 0 + description: Number of records to skip + default: 0 + title: Skip + description: Number of records to skip + - + name: limit + in: query + required: false + schema: + type: integer + maximum: 100 + minimum: 1 + description: Maximum records to return + default: 10 + title: Limit + description: Maximum records to return + - + name: status + in: query + required: false + schema: anyOf: - type: string - type: 'null' - title: Description - description: Description of the prompt set - default: null - active: - type: boolean - title: Active - description: Whether the prompt set is active - archive: - type: boolean - title: Archive - description: Whether the prompt set is archived - status: - type: string + description: Filter by status title: Status - description: Status of the prompt set - stats: - anyOf: - - $ref: '#/components/schemas/PromptSetStatsSchema' - - type: 'null' - description: Statistics about the prompt set - property_names: - items: - type: string - type: array - title: Property Names - description: Property names - created_by_user_id: - anyOf: - - type: string - format: uuid - - type: 'null' - title: Created By User Id - description: User ID who created the prompt set - created_at: - type: string - format: date-time - title: Created At - description: Creation timestamp - updated_at: - type: string - format: date-time - title: Updated At - description: Last update timestamp - type: object - required: - - uuid - - name - - active - - archive - - status - - created_at - - updated_at - title: CustomPromptSetListItemSchema - description: Schema for custom prompt set items in list responses. - CustomPromptSetListSchema: - properties: - pagination: - $ref: '#/components/schemas/PaginationSchema' - data: - items: - $ref: '#/components/schemas/CustomPromptSetListItemSchema' - type: array - title: Data - description: List of custom prompt sets - type: object - required: - - pagination - title: CustomPromptSetListSchema - description: Schema for custom prompt set list responses. - CustomPromptSetReferenceSchema: - properties: - uuid: - type: string - format: uuid - title: Uuid - description: UUID of the custom prompt set - name: - type: string - title: Name - description: Name of the prompt set - version: + description: Filter by status + - + name: active + in: query + required: false + schema: anyOf: - - type: string + - type: boolean - type: 'null' - title: Version - description: GCS generation number for snapshot versioning - status: - type: string - title: Status - description: Current status of the prompt set - active: - type: boolean + description: Filter by active status title: Active - description: Whether the prompt set is active - tsg_id: - type: string - title: Tsg Id - description: Tenant Security Group ID - created_at: - type: string - format: date-time - title: Created At - description: Creation timestamp - updated_at: - type: string - format: date-time - title: Updated At - description: Last update timestamp - type: object - required: - - uuid - - name - - status - - active - - tsg_id - - created_at - - updated_at - title: CustomPromptSetReferenceSchema - description: 'Reference schema for custom prompt sets used by data plane. - - - Contains minimal information needed for data plane to fetch - - configurations from GCS using the GCS-first pattern. - - ' - CustomPromptSetResponseSchema: - properties: - uuid: - type: string - format: uuid - title: Uuid - description: Unique identifier - name: - type: string - title: Name - description: Name of the prompt set - description: + description: Filter by active status + - + name: archive + in: query + required: false + schema: anyOf: - - type: string + - type: boolean - type: 'null' - title: Description - description: Description of the prompt set - default: null - active: - type: boolean - title: Active - description: Whether the prompt set is active - archive: - type: boolean + description: 'Filter by archive status (None=non-archived only, True=archived only, False=non-archived only)' title: Archive - description: Whether the prompt set is archived - status: - type: string - title: Status - description: Status of the prompt set - version: - anyOf: - - type: string - - type: 'null' - title: Version - description: GCS generation number for snapshot versioning - stats: - anyOf: - - $ref: '#/components/schemas/PromptSetStatsSchema' - - type: 'null' - description: Statistics about the prompt set - extra_info: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Extra Info - description: Additional information - property_names: - items: - type: string - type: array - title: Property Names - description: Property names - properties: - items: - $ref: '#/components/schemas/PropertyDefinitionSchema' - type: array - title: Properties - description: Property definitions - created_by_user_id: + description: 'Filter by archive status (None=non-archived only, True=archived only, False=non-archived only)' + - + name: search + in: query + required: false + schema: anyOf: - type: string - format: uuid - type: 'null' - title: Created By User Id - description: User ID who created the prompt set - updated_by_user_id: + description: Search in name and description + title: Search + description: Search in name and description + - + name: language + in: query + required: false + schema: anyOf: - type: string - format: uuid - type: 'null' - title: Updated By User Id - description: User ID who last updated the prompt set - created_at: + description: Filter by language code (ISO 639-1) + title: Language + description: Filter by language code (ISO 639-1) + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomPromptSetListSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attack/custom-prompt-set/{prompt_set_uuid}: + get: + tags: + - CustomAttack + summary: Get prompt set details + description: Retrieve a specific prompt set by UUID with complete details including properties. + operationId: get_prompt_set_v1_custom_attack_custom_prompt_set__prompt_set_uuid__get + parameters: + - + name: prompt_set_uuid + in: path + required: true + schema: type: string - format: date-time - title: Created At - description: Creation timestamp - updated_at: + format: uuid + title: Prompt Set Uuid + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomPromptSetResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + put: + tags: + - CustomAttack + summary: Update prompt set + description: 'Update prompt set details including name, description, and properties.' + operationId: update_prompt_set_v1_custom_attack_custom_prompt_set__prompt_set_uuid__put + parameters: + - + name: prompt_set_uuid + in: path + required: true + schema: type: string - format: date-time - title: Updated At - description: Last update timestamp - type: object - required: - - uuid - - name - - active - - archive - - status - - created_at - - updated_at - title: CustomPromptSetResponseSchema - description: Schema for custom prompt set responses. - CustomPromptSetUpdateRequestSchema: - properties: - name: - anyOf: - - type: string - maxLength: 255 - - type: 'null' - title: Name - description: Updated name - description: - anyOf: - - type: string - - type: 'null' - title: Description - description: Updated description - archive: - anyOf: - - type: boolean - - type: 'null' - title: Archive - description: Archive status - property_names: - anyOf: - - items: - type: string - type: array - maxItems: 2 - - type: 'null' - title: Property Names - description: Updated property names (max 2) - additionalProperties: false - type: object - title: CustomPromptSetUpdateRequestSchema - description: Schema for updating a custom prompt set. - CustomPromptSetVersionInfoSchema: - properties: - uuid: + format: uuid + title: Prompt Set Uuid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CustomPromptSetUpdateRequestSchema' + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomPromptSetResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attack/custom-prompt-set/{prompt_set_uuid}/archive: + put: + tags: + - CustomAttack + summary: Archive or unarchive a prompt set + description: Archive or unarchive a prompt set to manage its lifecycle. + operationId: archive_prompt_set_v1_custom_attack_custom_prompt_set__prompt_set_uuid__archive_put + parameters: + - + name: prompt_set_uuid + in: path + required: true + schema: type: string format: uuid - title: Uuid - description: UUID of the custom prompt set - version: - anyOf: - - type: string - - type: 'null' - title: Version - description: GCS generation number for this version - status: + title: Prompt Set Uuid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CustomPromptSetArchiveRequestSchema' + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomPromptSetResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attack/custom-prompt-set/custom-prompt: + post: + tags: + - CustomAttack + summary: Create prompt in a prompt set + description: Create a new prompt in a prompt set. + operationId: create_prompt_v1_custom_attack_custom_prompt_set_custom_prompt_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CustomPromptCreateRequestSchema' + required: true + responses: + 201: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomPromptResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attack/custom-prompt-set/{prompt_set_uuid}/list-custom-prompts: + get: + tags: + - CustomAttack + summary: List prompts in a prompt set + description: List all prompts within a specific prompt set with pagination and filtering. + operationId: list_prompts_in_set_v1_custom_attack_custom_prompt_set__prompt_set_uuid__list_custom_prompts_get + parameters: + - + name: prompt_set_uuid + in: path + required: true + schema: type: string - title: Status - description: Status when this version was created - stats: - anyOf: - - $ref: '#/components/schemas/PromptSetStatsSchema' - - type: 'null' - description: Prompt statistics when version was created - snapshot_created_at: + format: uuid + title: Prompt Set Uuid + - + name: skip + in: query + required: false + schema: + type: integer + minimum: 0 + description: Number of records to skip + default: 0 + title: Skip + description: Number of records to skip + - + name: limit + in: query + required: false + schema: + type: integer + maximum: 100 + minimum: 1 + description: Maximum records to return + default: 10 + title: Limit + description: Maximum records to return + - + name: status + in: query + required: false + schema: anyOf: - type: string - format: date-time - type: 'null' - title: Snapshot Created At - description: When the snapshot was created - is_latest: - type: boolean - title: Is Latest - description: Whether this is the latest version - type: object - required: - - uuid - - status - - is_latest - title: CustomPromptSetVersionInfoSchema - description: 'Version information for a custom prompt set snapshot. - - - Provides metadata about a specific version without full configuration data. - - ' - CustomPromptUpdateRequestSchema: - properties: - prompt: + description: Filter by status + title: Status + description: Filter by status + - + name: active + in: query + required: false + schema: anyOf: - - type: string + - type: boolean - type: 'null' - title: Prompt - description: Updated prompt text - goal: + description: Filter by active status + title: Active + description: Filter by active status + - + name: search + in: query + required: false + schema: anyOf: - type: string - type: 'null' - title: Goal - description: Updated goal - properties: - anyOf: - - additionalProperties: - type: string - type: object - - type: 'null' - title: Properties - description: Updated property assignments - additionalProperties: false - type: object - title: CustomPromptUpdateRequestSchema - description: Schema for updating a custom prompt. - DashboardOverviewResponseSchema: - properties: - total_targets: - type: integer - minimum: 0.0 - title: Total Targets - description: Total number of targets - targets_by_type: - items: - $ref: '#/components/schemas/CountByNameSchema' - type: array - title: Targets By Type - description: Target counts grouped by type (APPLICATION, AGENT, MODEL) - type: object - required: - - total_targets - title: DashboardOverviewResponseSchema - description: 'Dashboard overview response with target counts. - - - Endpoint: GET /api/v1/dashboard/overview - - Returns target counts by type in list format for easy frontend iteration. - - ' - DatabricksConnectionParams: - properties: - auth_type: - $ref: '#/components/schemas/AuthType' - description: Auth type - access_token: - anyOf: - - type: string - - type: 'null' - title: Access Token - description: Databricks access token - client_id: - anyOf: - - type: string - - type: 'null' - title: Client Id - description: Databricks client_id - secret: - anyOf: - - type: string - - type: 'null' - title: Secret - description: Databricks secret - workspace_url: - type: string - title: Workspace Url - description: Databricks workscpace_url - model_name: - type: string - title: Model Name - description: Databricks model name - type: object - required: - - auth_type - - workspace_url - - model_name - title: DatabricksConnectionParams - DatabricksConnectionRedactParams: - properties: - auth_type: - $ref: '#/components/schemas/AuthType' - description: Auth type - access_token: - anyOf: - - type: string - format: password - writeOnly: true - - type: 'null' - title: Access Token - description: Databricks access token - client_id: - anyOf: - - type: string - - type: 'null' - title: Client Id - description: Databricks client_id - secret: - anyOf: - - type: string - format: password - writeOnly: true - - type: 'null' - title: Secret - description: Databricks secret - workspace_url: - type: string - title: Workspace Url - description: Databricks workscpace_url - model_name: - type: string - title: Model Name - description: Databricks model name - type: object - required: - - auth_type - - workspace_url - - model_name - title: DatabricksConnectionRedactParams - HTTPValidationError: - properties: - detail: - items: - $ref: '#/components/schemas/ValidationError' - type: array - title: Detail - type: object - title: HTTPValidationError - HuggingfaceConnectionParams: - properties: - api_key: - type: string - title: Api Key - description: Huggingface API key for authentication - examples: - - sk-abxx - model_name: - type: string - title: Model Name - description: Huggingface model name for API requests - examples: - - gpt-4.1-nano - type: object - required: - - api_key - - model_name - title: HuggingfaceConnectionParams - description: Connection parameters specific to huggingface targets - HuggingfaceConnectionRedactParams: - properties: - api_key: + description: Search in prompt text + title: Search + description: Search in prompt text + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomPromptListSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attack/custom-prompt-set/{prompt_set_uuid}/custom-prompt/{prompt_uuid}: + get: + tags: + - CustomAttack + summary: Get prompt details + description: Get a specific prompt by UUID. + operationId: get_prompt_v1_custom_attack_custom_prompt_set__prompt_set_uuid__custom_prompt__prompt_uuid__get + parameters: + - + name: prompt_set_uuid + in: path + required: true + schema: type: string - format: password - title: Api Key - description: Huggingface API key for authentication - writeOnly: true - examples: - - sk-abxx - model_name: + format: uuid + title: Prompt Set Uuid + - + name: prompt_uuid + in: path + required: true + schema: type: string - title: Model Name - description: Huggingface model name for API requests - examples: - - gpt-4.1-nano - type: object - required: - - api_key - - model_name - title: HuggingfaceConnectionRedactParams - description: Connection parameters specific to huggingface targets - MultiTurnStatefulConfig: - properties: - type: + format: uuid + title: Prompt Uuid + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomPromptResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + put: + tags: + - CustomAttack + summary: Update prompt + description: Update an existing prompt. + operationId: update_prompt_v1_custom_attack_custom_prompt_set__prompt_set_uuid__custom_prompt__prompt_uuid__put + parameters: + - + name: prompt_set_uuid + in: path + required: true + schema: type: string - const: stateful - title: Type - default: stateful - response_id_field: + format: uuid + title: Prompt Set Uuid + - + name: prompt_uuid + in: path + required: true + schema: type: string - title: Response Id Field - description: JSON path to extract session ID from target response (e.g., - 'id' for OpenAI responses API) - examples: - - id - - conversation_id - - session.id - request_id_field: + format: uuid + title: Prompt Uuid + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CustomPromptUpdateRequestSchema' + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomPromptResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + delete: + tags: + - CustomAttack + summary: Delete prompt + description: Delete a prompt. + operationId: delete_prompt_v1_custom_attack_custom_prompt_set__prompt_set_uuid__custom_prompt__prompt_uuid__delete + parameters: + - + name: prompt_set_uuid + in: path + required: true + schema: type: string - title: Request Id Field - description: JSON path to inject session ID in next request (e.g., 'previous_response_id' - for OpenAI) - examples: - - previous_response_id - - conversation_id - - session_id - type: object - required: - - response_id_field - - request_id_field - title: MultiTurnStatefulConfig - description: 'Configuration for stateful multi-turn targets (session_supported=true). - - - Stateful targets maintain conversation state on the server side using session - IDs. - - The session ID is extracted from responses and injected into subsequent requests. - - ' - MultiTurnStatelessConfig: - properties: - type: + format: uuid + title: Prompt Set Uuid + - + name: prompt_uuid + in: path + required: true + schema: type: string - const: stateless - title: Type - default: stateless - assistant_role: - anyOf: - - type: string - - type: 'null' - title: Assistant Role - description: Role name for assistant messages in conversation history (e.g., - 'assistant', 'bot', 'model') - examples: - - assistant - - bot - - model - - ai - type: object - title: MultiTurnStatelessConfig - description: 'Configuration for stateless multi-turn targets (session_supported=false). - - - Stateless targets require the client to maintain and send conversation history. - - The assistant_role specifies the role name used for assistant messages in - the history. - - ' - OpenAIConnectionParams: - properties: - api_key: + format: uuid + title: Prompt Uuid + responses: + 204: + description: Successful Response + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attack/property-names: + get: + tags: + - CustomAttack + summary: Get property names + description: Get all available property names for use in prompt sets. + operationId: get_property_names_v1_custom_attack_property_names_get + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/PropertyNamesListResponseSchema' + 401: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + post: + tags: + - CustomAttack + summary: Create property name + description: Create a new property name that can be used in prompt sets. + operationId: create_property_name_v1_custom_attack_property_names_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PropertyNameCreateRequestSchema' + required: true + responses: + 201: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/PropertyNamesListResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attack/property-values/{property_name}: + get: + tags: + - CustomAttack + summary: Get property name + description: Get all available values for a specific property name. + operationId: get_property_values_v1_custom_attack_property_values__property_name__get + parameters: + - + name: property_name + in: path + required: true + schema: type: string - title: Api Key - description: OpenAI API key for authentication - examples: - - sk-abxx - model_name: + title: Property Name + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/PropertyValuesResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attack/property-values: + post: + tags: + - CustomAttack + summary: Create property value + description: Create a new value for an existing property name. + operationId: create_property_value_v1_custom_attack_property_values_post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PropertyValueCreateRequestSchema' + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/BaseResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + get: + tags: + - CustomAttack + summary: Get values for multiple property names + description: Get values for multiple property names in a single request. + operationId: get_property_values_multiple_v1_custom_attack_property_values_get + parameters: + - + name: property_names + in: query + required: true + schema: type: string - title: Model Name - description: OpenAI model name for API requests - examples: - - gpt-4.1-nano - type: object - required: - - api_key - - model_name - title: OpenAIConnectionParams - description: Connection parameters specific to OpenAI targets - OpenAIConnectionRedactParams: - properties: - api_key: + description: Comma-separated list of property names + title: Property Names + description: Comma-separated list of property names + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/PropertyValuesMultipleResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attack/upload-custom-prompts-csv: + post: + tags: + - CustomAttack + summary: Upload custom prompts + description: Upload a CSV file containing custom prompts with properties for a specific prompt set. + operationId: upload_prompts_csv_v1_custom_attack_upload_custom_prompts_csv_post + parameters: + - + name: prompt_set_uuid + in: query + required: true + schema: type: string - format: password - title: Api Key - description: OpenAI API key for authentication - writeOnly: true - examples: - - sk-abxx - model_name: + format: uuid + description: UUID of the prompt set + title: Prompt Set Uuid + description: UUID of the prompt set + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/Body_upload_prompts_csv_v1_custom_attack_upload_custom_prompts_csv_post' + responses: + 201: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/BaseResponseSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attack/download-template/{prompt_set_uuid}: + get: + tags: + - CustomAttack + summary: Download template for a prompt set + description: Download a CSV template with columns for the prompt set's properties. + operationId: download_template_v1_custom_attack_download_template__prompt_set_uuid__get + parameters: + - + name: prompt_set_uuid + in: path + required: true + schema: type: string - title: Model Name - description: OpenAI model name for API requests - examples: - - gpt-4.1-nano - type: object - required: - - api_key - - model_name - title: OpenAIConnectionRedactParams - description: Connection parameters specific to OpenAI targets - OtherDetails: - properties: - items: - additionalProperties: true - type: object - title: Items - type: object - title: OtherDetails - description: 'Additional profiler discoveries. Read-only key-value pairs. - - - Examples: code_execution_capability, internet_access, etc. - - ' - PaginationSchema: - properties: - total_items: - anyOf: - - type: integer - - type: 'null' - title: Total Items - type: object - title: PaginationSchema - ProfilingStatus: - type: string - enum: - - INIT - - QUEUED - - IN_PROGRESS - - COMPLETED - - FAILED - title: ProfilingStatus - description: Status of target profiling workflow. - PromptSetStatsSchema: + format: uuid + title: Prompt Set Uuid + responses: + 200: + description: Successful Response + content: + application/json: + schema: {} + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attack/active-custom-prompt-sets: + get: + tags: + - CustomAttack + summary: List active custom prompt sets + description: List all active custom prompt sets available for use by data plane. Returns only sets with snapshots. + operationId: list_active_prompt_sets_v1_custom_attack_active_custom_prompt_sets_get + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomPromptSetListActiveSchema' + 401: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attack/custom-prompt-set/{prompt_set_uuid}/reference: + get: + tags: + - CustomAttack + summary: Resolve prompt set reference + description: Get current reference information for a prompt set including latest version. + operationId: resolve_prompt_set_reference_v1_custom_attack_custom_prompt_set__prompt_set_uuid__reference_get + parameters: + - + name: prompt_set_uuid + in: path + required: true + schema: + type: string + format: uuid + title: Prompt Set Uuid + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomPromptSetReferenceSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/custom-attack/custom-prompt-set/{prompt_set_uuid}/version-info: + get: + tags: + - CustomAttack + summary: Get prompt set version information + description: Get detailed version information for a specific prompt set version. + operationId: get_prompt_set_version_info_v1_custom_attack_custom_prompt_set__prompt_set_uuid__version_info_get + parameters: + - + name: prompt_set_uuid + in: path + required: true + schema: + type: string + format: uuid + title: Prompt Set Uuid + - + name: version + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: Specific version ID + title: Version + description: Specific version ID + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/CustomPromptSetVersionInfoSchema' + 422: + description: Validation Error + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/dashboard/overview: + get: + tags: + - Dashboard + summary: Get dashboard overview + description: Returns target counts by type for dashboard display. + operationId: get_overview_v1_dashboard_overview_get + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/DashboardOverviewResponseSchema' + 401: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' + /v1/languages: + get: + tags: + - Languages + summary: Get available languages + description: Return allowed languages for the requesting tenant. + operationId: get_languages_v1_languages_get + responses: + 200: + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/TenantLanguagesResponseSchema' + 401: + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPValidationError' +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT + schemas: + AiGeneratedItems: properties: - total_prompts: - type: integer - title: Total Prompts - description: Total number of prompts - active_prompts: + languages_supported: + anyOf: + - $ref: '#/components/schemas/AiGeneratedLanguageListFieldInfo' + - type: 'null' + tools_accessible: + anyOf: + - $ref: '#/components/schemas/AiGeneratedListFieldInfo' + - type: 'null' + banned_keywords: + anyOf: + - $ref: '#/components/schemas/AiGeneratedListFieldInfo' + - type: 'null' + competitors: + anyOf: + - $ref: '#/components/schemas/AiGeneratedListFieldInfo' + - type: 'null' + base_model: + anyOf: + - $ref: '#/components/schemas/AiGeneratedStringFieldInfo' + - type: 'null' + core_architecture: + anyOf: + - $ref: '#/components/schemas/AiGeneratedStringFieldInfo' + - type: 'null' + system_prompt: + anyOf: + - $ref: '#/components/schemas/AiGeneratedStringFieldInfo' + - type: 'null' + type: object + title: AiGeneratedItems + description: Per-field AI tracking with item-level tags and counts. + AiGeneratedLanguageListFieldInfo: + properties: + ai_discovered_items: + items: + type: string + type: array + title: Ai Discovered Items + current_items: + items: + $ref: '#/components/schemas/AiLanguageItemTag' + type: array + title: Current Items + ai_count: type: integer - title: Active Prompts - description: Number of active prompts - failed_prompts: + title: Ai Count + default: 0 + user_count: type: integer - title: Failed Prompts - description: Number of failed prompts + title: User Count default: 0 - validation_prompts: + type: object + required: + - ai_discovered_items + - current_items + title: AiGeneratedLanguageListFieldInfo + description: AI tracking for the languages_supported list field. + AiGeneratedListFieldInfo: + properties: + ai_discovered_items: + items: + type: string + type: array + title: Ai Discovered Items + current_items: + items: + $ref: '#/components/schemas/AiItemTag' + type: array + title: Current Items + ai_count: type: integer - title: Validation Prompts - description: Number of validation prompts + title: Ai Count default: 0 - inactive_prompts: + user_count: type: integer - title: Inactive Prompts - description: Number of inactive prompts + title: User Count + default: 0 type: object required: - - total_prompts - - active_prompts - - inactive_prompts - title: PromptSetStatsSchema - description: Schema for prompt set statistics. - PropertyAssignmentSchema: + - ai_discovered_items + - current_items + title: AiGeneratedListFieldInfo + description: 'AI tracking for a list field (tools, keywords, competitors).' + AiGeneratedStringFieldInfo: properties: - property_name: - type: string - title: Property Name - description: Property name (e.g., 'industry', 'role') - property_value: + ai_discovered_value: type: string - title: Property Value - description: Property value (e.g., 'healthcare', 'CEO') + title: Ai Discovered Value + is_ai_generated: + type: boolean + title: Is Ai Generated + default: false type: object required: - - property_name - - property_value - title: PropertyAssignmentSchema - description: Schema for property name-value assignments. - PropertyDefinitionSchema: + - ai_discovered_value + title: AiGeneratedStringFieldInfo + description: 'AI tracking for a string field (base_model, core_architecture, system_prompt).' + AiItemTag: properties: - property_name: - type: string - title: Property Name - description: Property name - created_at: + value: type: string - format: date-time - title: Created At - description: When the property was created + title: Value + is_ai_generated: + type: boolean + title: Is Ai Generated type: object required: - - property_name - - created_at - title: PropertyDefinitionSchema - description: Schema for property definitions in a prompt set. - PropertyNameCreateRequestSchema: + - value + - is_ai_generated + title: AiItemTag + description: Single item with AI tracking tag. FE renders directly. + AiLanguageItemTag: properties: - name: + value: type: string - maxLength: 256 - title: Name - description: Name of the property - additionalProperties: false + title: Value + is_ai_generated: + type: boolean + title: Is Ai Generated + country_code: + anyOf: + - type: string + - type: 'null' + title: Country Code type: object required: - - name - title: PropertyNameCreateRequestSchema - description: Schema for creating a new property name. - PropertyNamesListResponseSchema: - properties: - data: - items: - type: string - type: array - title: Data - description: List of property names - type: object - title: PropertyNamesListResponseSchema - description: Schema for property names list responses. - PropertyValueCreateRequestSchema: + - value + - is_ai_generated + title: AiLanguageItemTag + description: 'AI tracking tag for language items, includes ISO 639-1 code for flag display.' + ApiEndpointType: + type: string + enum: + - PUBLIC + - PRIVATE + - NETWORK_BROKER + title: ApiEndpointType + description: API endpoint accessibility type. + BaseResponseSchema: properties: - property_name: + message: type: string - title: Property Name - description: Name of the property - property_value: - type: string - maxLength: 256 - title: Property Value - description: Value for the property - additionalProperties: false + title: Message + description: Response message + status: + type: integer + title: Status + description: HTTP status code type: object required: - - property_name - - property_value - title: PropertyValueCreateRequestSchema - description: Schema for creating a new property value. - PropertyValuesMultipleResponseSchema: + - message + - status + title: BaseResponseSchema + description: 'Standard response schema for simple operations like create, update, delete.' + BasicAuthAuthConfig: properties: - data: - additionalProperties: - items: + basic_auth_location: + $ref: '#/components/schemas/BasicAuthLocation' + description: 'Where credentials are sent: HEADER or PAYLOAD' + default: HEADER + basic_auth_header: + anyOf: + - + additionalProperties: type: string - type: array - type: object - title: Data - description: Dictionary mapping property names to their values + type: object + - type: 'null' + title: Basic Auth Header + description: 'Auth header as {name: value} dict (required when location=HEADER)' + examples: + - Authorization: Basic dXNlcjpwYXNz type: object - title: PropertyValuesMultipleResponseSchema - description: Schema for property values for multiple property names. - PropertyValuesResponseSchema: + title: BasicAuthAuthConfig + description: Basic Auth credentials — header or payload location. + BasicAuthAuthConfigRedact: properties: - name: - type: string - title: Name - description: Property name - values: - items: - type: string - type: array - title: Values - description: List of values for this property + basic_auth_location: + $ref: '#/components/schemas/BasicAuthLocation' + description: 'Where credentials are sent: HEADER or PAYLOAD' + default: HEADER + basic_auth_header: + anyOf: + - + additionalProperties: + type: string + type: object + - type: 'null' + title: Basic Auth Header + description: 'Auth header as {name: value} dict (required when location=HEADER)' + examples: + - Authorization: Basic dXNlcjpwYXNz type: object - required: - - name - title: PropertyValuesResponseSchema - description: Schema for property values for a specific property name. - ResponseMode: + title: BasicAuthAuthConfigRedact + BasicAuthLocation: type: string enum: - - REST - - STREAMING - title: ResponseMode - description: Response mode for target interactions. - RestConnectionParamsBase-Input: + - HEADER + - PAYLOAD + title: BasicAuthLocation + description: Where Basic Auth credentials are sent. + BedrockAccessConnectionParams: properties: - api_endpoint: + access_id: + type: string + title: Access Id + description: AWS access key ID + access_secret: + type: string + title: Access Secret + description: AWS secret access key + session_token: anyOf: - type: string - type: 'null' - title: Api Endpoint - description: API endpoint URL - examples: - - https://api.openai.com/v1/responses - request_headers: - additionalProperties: true - type: object - title: Request Headers - description: Request headers - default: null - examples: - - Authorization: Bearer sk-xxx - Content-Type: application/json - request_json: - additionalProperties: true - type: object - title: Request Json - description: Request JSON - default: null - examples: - - input: - - content: - - text: '{INPUT}' - type: input_text - role: user - model: gpt-4.1-nano - response_json: - additionalProperties: true - type: object - title: Response Json - description: Response JSON - default: null - examples: - - content: '{RESPONSE}' - response_key: + title: Session Token + description: AWS session token (optional) + region: type: string - title: Response Key - description: Response key - default: null - examples: - - content - target_connection_config: + title: Region + description: AWS region + model_id: + type: string + title: Model Id + description: Bedrock model ID + type: object + required: + - access_id + - access_secret + - region + - model_id + title: BedrockAccessConnectionParams + description: AWS Bedrock access parameters stored in target_metadata. + BedrockAccessConnectionRedactParams: + properties: + access_id: + type: string + format: password + title: Access Id + description: AWS access key ID + writeOnly: true + access_secret: + type: string + format: password + title: Access Secret + description: AWS secret access key + writeOnly: true + session_token: anyOf: - - $ref: '#/components/schemas/OpenAIConnectionParams' - - $ref: '#/components/schemas/HuggingfaceConnectionParams' - - $ref: '#/components/schemas/DatabricksConnectionParams' - - $ref: '#/components/schemas/BedrockAccessConnectionParams' + - + type: string + format: password + writeOnly: true - type: 'null' - title: Target Connection Config - description: Target Connection config of type openai/huggingface .. - curl: + title: Session Token + description: AWS session token (optional) + region: + type: string + title: Region + description: AWS region + model_id: + type: string + title: Model Id + description: Bedrock model ID + type: object + required: + - access_id + - access_secret + - region + - model_id + title: BedrockAccessConnectionRedactParams + description: AWS Bedrock access parameters stored in target_metadata. + Body_upload_prompts_csv_v1_custom_attack_upload_custom_prompts_csv_post: + properties: + file: + type: string + format: binary + title: File + type: object + required: + - file + title: Body_upload_prompts_csv_v1_custom_attack_upload_custom_prompts_csv_post + CountByNameSchema: + properties: + name: + type: string + title: Name + description: 'Name of the item (e.g., target type, status)' + count: + type: integer + minimum: 0.0 + title: Count + description: Count of items + type: object + required: + - name + - count + title: CountByNameSchema + description: | + Generic count schema with name field for extensible list structures. + + Used in dashboard and other endpoints to provide counts grouped by a name field. + Frontend-friendly list format for easy iteration. + CustomPromptCreateRequestSchema: + properties: + prompt: + type: string + title: Prompt + description: The prompt text + goal: anyOf: - type: string - type: 'null' - title: Curl - description: Generated cURL command ready to use (redacted for security) - examples: - - 'curl "https://api.openai.com/v1/chat/completions" -H "Content-Type: application/json" - -H "Authorization: Bearer ***" -d ''{"model":"gpt-4","messages":[{"role":"user","content":"{INPUT}"}]}''' - multi_turn_config: - anyOf: - - oneOf: - - $ref: '#/components/schemas/MultiTurnStatefulConfig' - - $ref: '#/components/schemas/MultiTurnStatelessConfig' - discriminator: - propertyName: type - mapping: - stateful: '#/components/schemas/MultiTurnStatefulConfig' - stateless: '#/components/schemas/MultiTurnStatelessConfig' - - type: 'null' - title: Multi Turn Config - description: Multi turn config for stateful or stateless target - examples: - - 'assistant_role: assistant' + title: Goal + description: Goal of the prompt (user-defined or AI-generated) + properties: + additionalProperties: + type: string + type: object + title: Properties + description: Property assignments (property_name -> property_value) + prompt_set_id: + type: string + format: uuid + title: Prompt Set Id + description: The UUID of the prompt set + additionalProperties: false type: object - title: RestConnectionParamsBase - description: Base connection parameters without generated fields. - RestConnectionParamsBase-Output: + required: + - prompt + - prompt_set_id + title: CustomPromptCreateRequestSchema + description: Schema for creating a new custom prompt. + CustomPromptListItemSchema: properties: - api_endpoint: + uuid: + type: string + format: uuid + title: Uuid + description: Unique identifier + prompt: + type: string + title: Prompt + description: The prompt text + goal: anyOf: - type: string - type: 'null' - title: Api Endpoint - description: API endpoint URL - examples: - - https://api.openai.com/v1/responses - request_headers: - additionalProperties: true - type: object - title: Request Headers - description: Request headers - default: null - examples: - - Authorization: Bearer sk-xxx - Content-Type: application/json - request_json: - additionalProperties: true - type: object - title: Request Json - description: Request JSON - default: null - examples: - - input: - - content: - - text: '{INPUT}' - type: input_text - role: user - model: gpt-4.1-nano - response_json: - additionalProperties: true + title: Goal + description: Goal of the prompt + user_defined_goal: + type: boolean + title: User Defined Goal + description: Whether the goal was user-defined + status: + type: string + title: Status + description: Status of the prompt + active: + type: boolean + title: Active + description: Whether the prompt is active + properties: + additionalProperties: + type: string type: object - title: Response Json - description: Response JSON - default: null - examples: - - content: '{RESPONSE}' - response_key: + title: Properties + description: Property assignments + created_at: type: string - title: Response Key - description: Response key - default: null - examples: - - content - target_connection_config: - anyOf: - - $ref: '#/components/schemas/OpenAIConnectionParams' - - $ref: '#/components/schemas/HuggingfaceConnectionParams' - - $ref: '#/components/schemas/DatabricksConnectionParams' - - $ref: '#/components/schemas/BedrockAccessConnectionParams' - - type: 'null' - title: Target Connection Config - description: Target Connection config of type openai/huggingface .. - curl: - anyOf: - - type: string - - type: 'null' - title: Curl - description: Generated cURL command ready to use (redacted for security) - examples: - - 'curl "https://api.openai.com/v1/chat/completions" -H "Content-Type: application/json" - -H "Authorization: Bearer ***" -d ''{"model":"gpt-4","messages":[{"role":"user","content":"{INPUT}"}]}''' - multi_turn_config: - anyOf: - - oneOf: - - $ref: '#/components/schemas/MultiTurnStatefulConfig' - - $ref: '#/components/schemas/MultiTurnStatelessConfig' - discriminator: - propertyName: type - mapping: - stateful: '#/components/schemas/MultiTurnStatefulConfig' - stateless: '#/components/schemas/MultiTurnStatelessConfig' - - type: 'null' - title: Multi Turn Config - description: Multi turn config for stateful or stateless target - examples: - - 'assistant_role: assistant' + format: date-time + title: Created At + description: Creation timestamp + updated_at: + type: string + format: date-time + title: Updated At + description: Last update timestamp type: object - title: RestConnectionParamsBase - description: Base connection parameters without generated fields. - RestConnectionParamsRedactBase: + required: + - uuid + - prompt + - user_defined_goal + - status + - active + - created_at + - updated_at + title: CustomPromptListItemSchema + description: Schema for custom prompt items in list responses. + CustomPromptListSchema: properties: - api_endpoint: - anyOf: - - type: string - - type: 'null' - title: Api Endpoint - description: API endpoint URL - examples: - - https://api.openai.com/v1/responses - request_headers: - additionalProperties: true - type: object - title: Request Headers - description: Request headers - default: null - examples: - - Authorization: Bearer sk-xxx - Content-Type: application/json - request_json: - additionalProperties: true - type: object - title: Request Json - description: Request JSON - default: null - examples: - - input: - - content: - - text: '{INPUT}' - type: input_text - role: user - model: gpt-4.1-nano - response_json: - additionalProperties: true - type: object - title: Response Json - description: Response JSON - default: null - examples: - - content: '{RESPONSE}' - response_key: + pagination: + $ref: '#/components/schemas/PaginationSchema' + data: + items: + $ref: '#/components/schemas/CustomPromptListItemSchema' + type: array + title: Data + description: List of custom prompts + type: object + required: + - pagination + title: CustomPromptListSchema + description: Schema for custom prompt list responses. + CustomPromptResponseSchema: + properties: + uuid: type: string - title: Response Key - description: Response key - default: null - examples: - - content - target_connection_config: - anyOf: - - $ref: '#/components/schemas/OpenAIConnectionRedactParams' - - $ref: '#/components/schemas/HuggingfaceConnectionRedactParams' - - $ref: '#/components/schemas/DatabricksConnectionRedactParams' - - $ref: '#/components/schemas/BedrockAccessConnectionRedactParams' - - type: 'null' - title: Target Connection Config - description: Target Connection config of type openai/huggingface .. - curl: + format: uuid + title: Uuid + description: Unique identifier + prompt: + type: string + title: Prompt + description: The prompt text + goal: anyOf: - type: string - type: 'null' - title: Curl - description: Generated cURL command ready to use (redacted for security) - examples: - - 'curl "https://api.openai.com/v1/chat/completions" -H "Content-Type: application/json" - -H "Authorization: Bearer ***" -d ''{"model":"gpt-4","messages":[{"role":"user","content":"{INPUT}"}]}''' - multi_turn_config: + title: Goal + description: Goal of the prompt + user_defined_goal: + type: boolean + title: User Defined Goal + description: Whether the goal was user-defined + detector_category: anyOf: - - oneOf: - - $ref: '#/components/schemas/MultiTurnStatefulConfig' - - $ref: '#/components/schemas/MultiTurnStatelessConfig' - discriminator: - propertyName: type - mapping: - stateful: '#/components/schemas/MultiTurnStatefulConfig' - stateless: '#/components/schemas/MultiTurnStatelessConfig' + - type: string - type: 'null' - title: Multi Turn Config - description: Multi turn config for stateful or stateless target - examples: - - 'assistant_role: assistant' - type: object - title: RestConnectionParamsRedactBase - StreamingConnectionParamsBase-Input: - properties: - api_endpoint: + title: Detector Category + description: Detector category + severity: anyOf: - type: string - type: 'null' - title: Api Endpoint - description: API endpoint URL - examples: - - https://api.openai.com/v1/responses - request_headers: - additionalProperties: true - type: object - title: Request Headers - description: Request headers - default: null - examples: - - Authorization: Bearer sk-xxx - Content-Type: application/json - request_json: - additionalProperties: true - type: object - title: Request Json - description: Request JSON - default: null - examples: - - input: - - content: - - text: '{INPUT}' - type: input_text - role: user - model: gpt-4.1-nano - response_json: - additionalProperties: true - type: object - title: Response Json - description: Response JSON - default: null - examples: - - content: '{RESPONSE}' - response_key: + title: Severity + description: Severity level + status: type: string - title: Response Key - description: Response key - default: null - examples: - - content - target_connection_config: - anyOf: - - $ref: '#/components/schemas/OpenAIConnectionParams' - - $ref: '#/components/schemas/HuggingfaceConnectionParams' - - $ref: '#/components/schemas/DatabricksConnectionParams' - - $ref: '#/components/schemas/BedrockAccessConnectionParams' - - type: 'null' - title: Target Connection Config - description: Target Connection config of type openai/huggingface .. - curl: + title: Status + description: Status of the prompt + active: + type: boolean + title: Active + description: Whether the prompt is active + extra_info: anyOf: - - type: string + - + additionalProperties: true + type: object - type: 'null' - title: Curl - description: Generated cURL command ready to use (redacted for security) - examples: - - 'curl "https://api.openai.com/v1/chat/completions" -H "Content-Type: application/json" - -H "Authorization: Bearer ***" -d ''{"model":"gpt-4","messages":[{"role":"user","content":"{INPUT}"}]}''' - multi_turn_config: - anyOf: - - oneOf: - - $ref: '#/components/schemas/MultiTurnStatefulConfig' - - $ref: '#/components/schemas/MultiTurnStatelessConfig' - discriminator: - propertyName: type - mapping: - stateful: '#/components/schemas/MultiTurnStatefulConfig' - stateless: '#/components/schemas/MultiTurnStatelessConfig' - - type: 'null' - title: Multi Turn Config - description: Multi turn config for stateful or stateless target - examples: - - 'assistant_role: assistant' - response_stop_key: + title: Extra Info + description: Additional information + prompt_set_id: type: string - title: Response Stop Key - response_stop_value: + format: uuid + title: Prompt Set Id + description: The UUID of the prompt set this prompt belongs to + properties: + additionalProperties: + type: string + type: object + title: Properties + description: Property assignments + property_assignments: + items: + $ref: '#/components/schemas/PropertyAssignmentSchema' + type: array + title: Property Assignments + description: Detailed property assignments + created_at: type: string - title: Response Stop Value + format: date-time + title: Created At + description: Creation timestamp + updated_at: + type: string + format: date-time + title: Updated At + description: Last update timestamp type: object required: - - response_stop_key - - response_stop_value - title: StreamingConnectionParamsBase - description: Base streaming connection parameters without generated fields. - StreamingConnectionParamsBase-Output: + - uuid + - prompt + - user_defined_goal + - status + - active + - prompt_set_id + - created_at + - updated_at + title: CustomPromptResponseSchema + description: Schema for custom prompt responses. + CustomPromptSetArchiveRequestSchema: properties: - api_endpoint: + archive: + type: boolean + title: Archive + description: 'True to archive, False to unarchive' + additionalProperties: false + type: object + required: + - archive + title: CustomPromptSetArchiveRequestSchema + description: Schema for archiving/unarchiving prompt sets. + CustomPromptSetCreateRequestSchema: + properties: + name: + type: string + maxLength: 255 + title: Name + description: Name of the custom prompt set + description: anyOf: - type: string - type: 'null' - title: Api Endpoint - description: API endpoint URL - examples: - - https://api.openai.com/v1/responses - request_headers: - additionalProperties: true - type: object - title: Request Headers - description: Request headers - default: null - examples: - - Authorization: Bearer sk-xxx - Content-Type: application/json - request_json: - additionalProperties: true - type: object - title: Request Json - description: Request JSON - default: null - examples: - - input: - - content: - - text: '{INPUT}' - type: input_text - role: user - model: gpt-4.1-nano - response_json: - additionalProperties: true - type: object - title: Response Json - description: Response JSON - default: null - examples: - - content: '{RESPONSE}' - response_key: + title: Description + description: Description of the custom prompt set + default: + property_names: + items: + type: string + type: array + maxItems: 2 + title: Property Names + description: Property names for this prompt set (max 2) + language: + $ref: '#/components/schemas/SupportedLanguage' + description: Language code (ISO 639-1) for prompts in this set + default: en + additionalProperties: false + type: object + required: + - name + title: CustomPromptSetCreateRequestSchema + description: Schema for creating a new custom prompt set. + CustomPromptSetListActiveSchema: + properties: + data: + items: + $ref: '#/components/schemas/CustomPromptSetReferenceSchema' + type: array + title: Data + description: List of active custom prompt set references + type: object + title: CustomPromptSetListActiveSchema + description: | + Schema for listing active custom prompt sets available for use. + + Used by data plane to discover available prompt sets for job creation. + CustomPromptSetListItemSchema: + properties: + uuid: type: string - title: Response Key - description: Response key - default: null - examples: - - content - target_connection_config: + format: uuid + title: Uuid + description: Unique identifier + name: + type: string + title: Name + description: Name of the prompt set + description: anyOf: - - $ref: '#/components/schemas/OpenAIConnectionParams' - - $ref: '#/components/schemas/HuggingfaceConnectionParams' - - $ref: '#/components/schemas/DatabricksConnectionParams' - - $ref: '#/components/schemas/BedrockAccessConnectionParams' + - type: string - type: 'null' - title: Target Connection Config - description: Target Connection config of type openai/huggingface .. - curl: + title: Description + description: Description of the prompt set + default: + language: + $ref: '#/components/schemas/LanguageOptionSchema' + description: Language of prompts in this set + active: + type: boolean + title: Active + description: Whether the prompt set is active + archive: + type: boolean + title: Archive + description: Whether the prompt set is archived + status: + type: string + title: Status + description: Status of the prompt set + stats: anyOf: - - type: string + - $ref: '#/components/schemas/PromptSetStatsSchema' - type: 'null' - title: Curl - description: Generated cURL command ready to use (redacted for security) - examples: - - 'curl "https://api.openai.com/v1/chat/completions" -H "Content-Type: application/json" - -H "Authorization: Bearer ***" -d ''{"model":"gpt-4","messages":[{"role":"user","content":"{INPUT}"}]}''' - multi_turn_config: + description: Statistics about the prompt set + property_names: + items: + type: string + type: array + title: Property Names + description: Property names + created_by_user_id: anyOf: - - oneOf: - - $ref: '#/components/schemas/MultiTurnStatefulConfig' - - $ref: '#/components/schemas/MultiTurnStatelessConfig' - discriminator: - propertyName: type - mapping: - stateful: '#/components/schemas/MultiTurnStatefulConfig' - stateless: '#/components/schemas/MultiTurnStatelessConfig' + - + type: string + format: uuid - type: 'null' - title: Multi Turn Config - description: Multi turn config for stateful or stateless target - examples: - - 'assistant_role: assistant' - response_stop_key: + title: Created By User Id + description: User ID who created the prompt set + created_at: type: string - title: Response Stop Key - response_stop_value: + format: date-time + title: Created At + description: Creation timestamp + updated_at: type: string - title: Response Stop Value + format: date-time + title: Updated At + description: Last update timestamp type: object required: - - response_stop_key - - response_stop_value - title: StreamingConnectionParamsBase - description: Base streaming connection parameters without generated fields. - StreamingConnectionParamsRedactBase: + - uuid + - name + - active + - archive + - status + - created_at + - updated_at + title: CustomPromptSetListItemSchema + description: Schema for custom prompt set items in list responses. + CustomPromptSetListSchema: properties: - api_endpoint: + pagination: + $ref: '#/components/schemas/PaginationSchema' + data: + items: + $ref: '#/components/schemas/CustomPromptSetListItemSchema' + type: array + title: Data + description: List of custom prompt sets + type: object + required: + - pagination + title: CustomPromptSetListSchema + description: Schema for custom prompt set list responses. + CustomPromptSetReferenceSchema: + properties: + uuid: + type: string + format: uuid + title: Uuid + description: UUID of the custom prompt set + name: + type: string + title: Name + description: Name of the prompt set + language: + $ref: '#/components/schemas/SupportedLanguage' + description: Language of prompts in this set + default: en + version: anyOf: - type: string - type: 'null' - title: Api Endpoint - description: API endpoint URL - examples: - - https://api.openai.com/v1/responses - request_headers: - additionalProperties: true - type: object - title: Request Headers - description: Request headers - default: null - examples: - - Authorization: Bearer sk-xxx - Content-Type: application/json - request_json: - additionalProperties: true - type: object - title: Request Json - description: Request JSON - default: null - examples: - - input: - - content: - - text: '{INPUT}' - type: input_text - role: user - model: gpt-4.1-nano - response_json: - additionalProperties: true - type: object - title: Response Json - description: Response JSON - default: null - examples: - - content: '{RESPONSE}' - response_key: + title: Version + description: GCS generation number for snapshot versioning + status: type: string - title: Response Key - description: Response key - default: null - examples: - - content - target_connection_config: - anyOf: - - $ref: '#/components/schemas/OpenAIConnectionRedactParams' - - $ref: '#/components/schemas/HuggingfaceConnectionRedactParams' - - $ref: '#/components/schemas/DatabricksConnectionRedactParams' - - $ref: '#/components/schemas/BedrockAccessConnectionRedactParams' - - type: 'null' - title: Target Connection Config - description: Target Connection config of type openai/huggingface .. - curl: - anyOf: - - type: string - - type: 'null' - title: Curl - description: Generated cURL command ready to use (redacted for security) - examples: - - 'curl "https://api.openai.com/v1/chat/completions" -H "Content-Type: application/json" - -H "Authorization: Bearer ***" -d ''{"model":"gpt-4","messages":[{"role":"user","content":"{INPUT}"}]}''' - multi_turn_config: - anyOf: - - oneOf: - - $ref: '#/components/schemas/MultiTurnStatefulConfig' - - $ref: '#/components/schemas/MultiTurnStatelessConfig' - discriminator: - propertyName: type - mapping: - stateful: '#/components/schemas/MultiTurnStatefulConfig' - stateless: '#/components/schemas/MultiTurnStatelessConfig' - - type: 'null' - title: Multi Turn Config - description: Multi turn config for stateful or stateless target - examples: - - 'assistant_role: assistant' - response_stop_key: + title: Status + description: Current status of the prompt set + active: + type: boolean + title: Active + description: Whether the prompt set is active + tsg_id: type: string - title: Response Stop Key - response_stop_value: + title: Tsg Id + description: Tenant Security Group ID + created_at: type: string - title: Response Stop Value + format: date-time + title: Created At + description: Creation timestamp + updated_at: + type: string + format: date-time + title: Updated At + description: Last update timestamp type: object required: - - response_stop_key - - response_stop_value - title: StreamingConnectionParamsRedactBase - TargetAdditionalContext: + - uuid + - name + - status + - active + - tsg_id + - created_at + - updated_at + title: CustomPromptSetReferenceSchema + description: | + Reference schema for custom prompt sets used by data plane. + + Contains minimal information needed for data plane to fetch + configurations from GCS using the GCS-first pattern. + CustomPromptSetResponseSchema: properties: - base_model: + uuid: + type: string + format: uuid + title: Uuid + description: Unique identifier + name: + type: string + title: Name + description: Name of the prompt set + description: anyOf: - type: string - type: 'null' - title: Base Model - description: Base model name (e.g., GPT-4, Claude) - core_architecture: + title: Description + description: Description of the prompt set + default: + language: + $ref: '#/components/schemas/LanguageOptionSchema' + description: Language of prompts in this set + active: + type: boolean + title: Active + description: Whether the prompt set is active + archive: + type: boolean + title: Archive + description: Whether the prompt set is archived + status: + type: string + title: Status + description: Status of the prompt set + version: anyOf: - type: string - type: 'null' - title: Core Architecture - description: Core architecture details - system_prompt: + title: Version + description: GCS generation number for snapshot versioning + stats: anyOf: - - type: string + - $ref: '#/components/schemas/PromptSetStatsSchema' - type: 'null' - title: System Prompt - description: System prompt - languages_supported: + description: Statistics about the prompt set + extra_info: anyOf: - - items: - type: string - type: array + - + additionalProperties: true + type: object - type: 'null' - title: Languages Supported - description: Supported languages - banned_keywords: + title: Extra Info + description: Additional information + property_names: + items: + type: string + type: array + title: Property Names + description: Property names + properties: + items: + $ref: '#/components/schemas/PropertyDefinitionSchema' + type: array + title: Properties + description: Property definitions + created_by_user_id: anyOf: - - items: - type: string - type: array + - + type: string + format: uuid - type: 'null' - title: Banned Keywords - description: Banned keywords/phrases - tools_accessible: + title: Created By User Id + description: User ID who created the prompt set + updated_by_user_id: anyOf: - - items: - type: string - type: array + - + type: string + format: uuid - type: 'null' - title: Tools Accessible - description: Accessible tools/capabilities + title: Updated By User Id + description: User ID who last updated the prompt set + created_at: + type: string + format: date-time + title: Created At + description: Creation timestamp + updated_at: + type: string + format: date-time + title: Updated At + description: Last update timestamp type: object - title: TargetAdditionalContext - description: 'Additional context - used in create/update API requests and stored - in DB/GCS. - - - Single value fields are strings. - - List fields are lists of strings. - - ' - TargetBackground: + required: + - uuid + - name + - active + - archive + - status + - created_at + - updated_at + title: CustomPromptSetResponseSchema + description: Schema for custom prompt set responses. + CustomPromptSetUpdateRequestSchema: properties: - industry: + name: anyOf: - - type: string + - + type: string + maxLength: 255 - type: 'null' - title: Industry - description: Target's industry (e.g., Healthcare, Finance) - use_case: + title: Name + description: Updated name + description: anyOf: - type: string - type: 'null' - title: Use Case - description: Primary use case (e.g., Customer Support, Code Assistant) - competitors: + title: Description + description: Updated description + archive: anyOf: - - items: + - type: boolean + - type: 'null' + title: Archive + description: Archive status + property_names: + anyOf: + - + items: type: string type: array + maxItems: 2 - type: 'null' - title: Competitors - description: Known competitor products + title: Property Names + description: Updated property names (max 2) + additionalProperties: false type: object - title: TargetBackground - description: 'Target background - used in create/update API requests and stored - in DB/GCS. - - - Required fields for activation: - - - industry (string, required) - - - use_case (string, required) - - - Optional field: - - - competitors (list of strings) - - ' - TargetConnectionType: - type: string - enum: - - DATABRICKS - - BEDROCK - - OPENAI - - HUGGING_FACE - - CUSTOM - - REST - - STREAMING - title: TargetConnectionType - description: Connection type/provider for the target. - TargetContextUpdateSchema: - properties: - target_background: - anyOf: - - $ref: '#/components/schemas/TargetBackground' - - type: 'null' - description: 'Target background: industry, use_case, competitors' - additional_context: - anyOf: - - $ref: '#/components/schemas/TargetAdditionalContext' - - type: 'null' - description: 'Additional context: base_model, system_prompt, languages, - etc.' - type: object - title: TargetContextUpdateSchema - description: 'Request schema for updating target profile (background + additional - context). - - - Used by PUT /{target_uuid}/profile endpoint. - - User provides plain values which are saved directly to DB and GCS. - - ' - TargetCreateRequestSchema: + title: CustomPromptSetUpdateRequestSchema + description: Schema for updating a custom prompt set. + CustomPromptSetVersionInfoSchema: properties: - connection_params: - anyOf: - - $ref: '#/components/schemas/RestConnectionParamsBase-Input' - - $ref: '#/components/schemas/StreamingConnectionParamsBase-Input' - - type: 'null' - title: Connection Params - description: API connection parameters (sensitive data masked for security) - network_broker_channel_uuid: - anyOf: - - type: string - format: uuid - - type: 'null' - title: Network Broker Channel Uuid - description: Network broker channel UUID for routing requests. Required - when api_endpoint_type is NETWORK_BROKER. - examples: - - 550e8400-e29b-41d4-a716-446655440000 - name: + uuid: type: string - title: Name - description: Target name - examples: - - GPT 4.1 Nano - description: + format: uuid + title: Uuid + description: UUID of the custom prompt set + version: anyOf: - type: string - type: 'null' - title: Description - description: Optional target description - default: null - examples: - - AI model for testing - target_type: - anyOf: - - $ref: '#/components/schemas/TargetType' - - type: 'null' - description: Type of target - connection_type: - anyOf: - - $ref: '#/components/schemas/TargetConnectionType' - - type: 'null' - description: Connection type/provider for the target - examples: - - CUSTOM - - OPENAI - - BEDROCK - api_endpoint_type: + title: Version + description: GCS generation number for this version + status: + type: string + title: Status + description: Status when this version was created + stats: anyOf: - - $ref: '#/components/schemas/ApiEndpointType' + - $ref: '#/components/schemas/PromptSetStatsSchema' - type: 'null' - description: Accessibility type of the API endpoint - examples: - - PUBLIC - - PRIVATE - - NETWORK_BROKER - response_mode: + description: Prompt statistics when version was created + snapshot_created_at: anyOf: - - $ref: '#/components/schemas/ResponseMode' + - + type: string + format: date-time - type: 'null' - description: Response mode for API interactions - examples: - - REST - - STREAMING - session_supported: + title: Snapshot Created At + description: When the snapshot was created + is_latest: type: boolean - title: Session Supported - description: Whether target supports session for multi-turn conversations - default: false - extra_info: + title: Is Latest + description: Whether this is the latest version + type: object + required: + - uuid + - status + - is_latest + title: CustomPromptSetVersionInfoSchema + description: | + Version information for a custom prompt set snapshot. + + Provides metadata about a specific version without full configuration data. + CustomPromptUpdateRequestSchema: + properties: + prompt: anyOf: - - additionalProperties: true - type: object + - type: string - type: 'null' - title: Extra Info - description: Additional configuration or metadata for the target - default: null - examples: - - custom_key: custom_value - target_metadata: - $ref: '#/components/schemas/TargetMetadata' - description: Target metadata and configuration options - target_background: + title: Prompt + description: Updated prompt text + goal: anyOf: - - $ref: '#/components/schemas/TargetBackground' + - type: string - type: 'null' - description: 'Target background: industry, use_case, competitors' - additional_context: + title: Goal + description: Updated goal + properties: anyOf: - - $ref: '#/components/schemas/TargetAdditionalContext' + - + additionalProperties: + type: string + type: object - type: 'null' - description: 'Additional context: base_model, system_prompt, languages, - etc.' + title: Properties + description: Updated property assignments additionalProperties: false type: object + title: CustomPromptUpdateRequestSchema + description: Schema for updating a custom prompt. + DashboardOverviewResponseSchema: + properties: + total_targets: + type: integer + minimum: 0.0 + title: Total Targets + description: Total number of targets + targets_by_type: + items: + $ref: '#/components/schemas/CountByNameSchema' + type: array + title: Targets By Type + description: 'Target counts grouped by type (APPLICATION, AGENT, MODEL)' + type: object required: - - name - title: TargetCreateRequestSchema - description: Target create request schema for validating and defining target - creation parameters. - TargetListItemSchema: + - total_targets + title: DashboardOverviewResponseSchema + description: | + Dashboard overview response with target counts. + + Endpoint: GET /api/v1/dashboard/overview + Returns target counts by type in list format for easy frontend iteration. + DatabricksConnectionParams: properties: - uuid: - type: string - format: uuid - title: Uuid - tsg_id: - type: string - title: Tsg Id - name: - type: string - title: Name - description: Target name - examples: - - GPT 4.1 Nano - description: + auth_type: + $ref: '#/components/schemas/red_team_shared__schemas__databricks__AuthType' + description: Auth type + access_token: anyOf: - type: string - type: 'null' - title: Description - description: Optional target description - default: null - examples: - - AI model for testing - target_type: + title: Access Token + description: Databricks access token + client_id: anyOf: - - $ref: '#/components/schemas/TargetType' + - type: string - type: 'null' - description: Type of target - connection_type: + title: Client Id + description: Databricks client_id + secret: anyOf: - - $ref: '#/components/schemas/TargetConnectionType' + - type: string - type: 'null' - description: Connection type/provider for the target - examples: - - CUSTOM - - OPENAI - - BEDROCK - api_endpoint_type: + title: Secret + description: Databricks secret + workspace_url: + type: string + title: Workspace Url + description: Databricks workscpace_url + model_name: + type: string + title: Model Name + description: Databricks model name + type: object + required: + - auth_type + - workspace_url + - model_name + title: DatabricksConnectionParams + DatabricksConnectionRedactParams: + properties: + auth_type: + $ref: '#/components/schemas/red_team_shared__schemas__databricks__AuthType' + description: Auth type + access_token: anyOf: - - $ref: '#/components/schemas/ApiEndpointType' + - + type: string + format: password + writeOnly: true - type: 'null' - description: Accessibility type of the API endpoint - examples: - - PUBLIC - - PRIVATE - - NETWORK_BROKER - response_mode: + title: Access Token + description: Databricks access token + client_id: anyOf: - - $ref: '#/components/schemas/ResponseMode' + - type: string - type: 'null' - description: Response mode for API interactions - examples: - - REST - - STREAMING - session_supported: - type: boolean - title: Session Supported - description: Whether target supports session for multi-turn conversations - default: false - extra_info: + title: Client Id + description: Databricks client_id + secret: anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Extra Info - description: Additional configuration or metadata for the target - default: null - examples: - - custom_key: custom_value - status: - $ref: '#/components/schemas/TargetStatus' - description: Target status - active: - type: boolean - title: Active - description: Whether target is active - validated: - type: boolean - title: Validated - description: Whether target is validated - version: - anyOf: - - type: integer - - type: 'null' - title: Version - description: Configuration version - secret_version: - anyOf: - - type: string - - type: 'null' - title: Secret Version - description: Secret Manager version for connection_params. When present, - sensitive connection data is stored in Secret Manager. When None, connection_params - are stored in GCS (legacy). - created_by_user_id: - anyOf: - - type: string - format: uuid - - type: 'null' - title: Created By User Id - description: User ID of target creator - updated_by_user_id: - anyOf: - - type: string - format: uuid + - + type: string + format: password + writeOnly: true - type: 'null' - title: Updated By User Id - description: User ID of last target updater - created_at: + title: Secret + description: Databricks secret + workspace_url: type: string - format: date-time - title: Created At - description: Creation timestamp - updated_at: + title: Workspace Url + description: Databricks workscpace_url + model_name: type: string - format: date-time - title: Updated At - description: Last update timestamp + title: Model Name + description: Databricks model name type: object required: - - uuid - - tsg_id - - name - - status - - active - - validated - - created_at - - updated_at - title: TargetListItemSchema - TargetListSchema: + - auth_type + - workspace_url + - model_name + title: DatabricksConnectionRedactParams + HTTPValidationError: properties: - pagination: - $ref: '#/components/schemas/PaginationSchema' - data: + detail: items: - $ref: '#/components/schemas/TargetListItemSchema' + $ref: '#/components/schemas/ValidationError' type: array - title: Data - description: List of targets + title: Detail type: object - required: - - pagination - title: TargetListSchema - description: Schema returned by API for list target operations. - TargetMetadata: + title: HTTPValidationError + HeadersAuthConfig: properties: - multi_turn: - type: boolean - title: Multi Turn - description: Whether target supports multi-turn conversations (Probe 2 result) - default: false - multi_turn_error_message: - anyOf: - - type: string - - type: 'null' - title: Multi Turn Error Message - description: Concise error message if Probe 2 failed - examples: - - Session ID extraction failed - - Assistant role not configured - rate_limit: - anyOf: - - type: integer - - type: 'null' - title: Rate Limit - description: Current rate limit value - examples: - - 996 - rate_limit_enabled: - type: boolean - title: Rate Limit Enabled - description: Whether rate limiting is enabled - default: false - rate_limit_error_code: - anyOf: - - type: integer - - type: 'null' - title: Rate Limit Error Code - description: HTTP status code for rate limit errors - examples: - - 429 - rate_limit_error_json: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Rate Limit Error Json - description: JSON structure of rate limit error response + auth_header: + additionalProperties: + type: string + type: object + title: Auth Header + description: 'Auth header as {name: value} dict' examples: - - error: - code: rate_limit_exceeded - message: 'Rate limit reached for o1-preview on requests per min (RPM): - Limit 20, Used 20, Requested 1. Please try again in 3s. Visit https://platform.openai.com/account/rate-limits - to learn more.' - param: 'null' - type: requests - rate_limit_error_message: - anyOf: - - type: string - - type: 'null' - title: Rate Limit Error Message - description: Raw error message string for rate limit errors + - Authorization: Bearer sk-xxxxxxxxxxxx + - x-api-key: my-api-key + type: object + required: + - auth_header + title: HeadersAuthConfig + description: 'Static header injection (API keys, bearer tokens).' + HeadersAuthConfigRedact: + properties: + auth_header: + additionalProperties: + type: string + type: object + title: Auth Header + description: 'Auth header as {name: value} dict' examples: - - 'Rate limit reached for o1-preview on requests per min (RPM): Limit 20, - Used 20, Requested 1. Please try again in 3s.' - content_filter_enabled: - type: boolean - title: Content Filter Enabled - description: Whether content filtering is enabled - default: false - content_filter_error_code: - anyOf: - - type: integer - - type: 'null' - title: Content Filter Error Code - description: HTTP status code for content filter errors + - Authorization: Bearer sk-xxxxxxxxxxxx + - x-api-key: my-api-key + type: object + required: + - auth_header + title: HeadersAuthConfigRedact + HuggingfaceConnectionParams: + properties: + api_key: + type: string + title: Api Key + description: Huggingface API key for authentication examples: - - 400 - content_filter_error_json: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Content Filter Error Json - description: JSON structure of content filter error response + - sk-abxx + model_name: + type: string + title: Model Name + description: Huggingface model name for API requests examples: - - error: - code: invalid_prompt - message: 'Invalid prompt: your prompt was flagged as potentially violating - our usage policy. Please try again with a different prompt.' - type: invalid_request_error - content_filter_error_message: - anyOf: - - type: string - - type: 'null' - title: Content Filter Error Message - description: Raw error message string for content filter errors + - gpt-4.1-nano + type: object + required: + - api_key + - model_name + title: HuggingfaceConnectionParams + description: Connection parameters specific to huggingface targets + HuggingfaceConnectionRedactParams: + properties: + api_key: + type: string + format: password + title: Api Key + description: Huggingface API key for authentication + writeOnly: true examples: - - 'Invalid prompt: your prompt was flagged as potentially violating our - usage policy. Please try again with a different prompt.' - probe_message: + - sk-abxx + model_name: type: string - title: Probe Message - default: Hello, this is a test message from the red team validation system. - request_timeout: - type: number - title: Request Timeout - description: Request timeout in seconds - default: 110 + title: Model Name + description: Huggingface model name for API requests examples: - - 110 + - gpt-4.1-nano type: object - title: TargetMetadata - description: Metadata stored in the database for targets (user-provided + computed - fields). - TargetProbeRequest: + required: + - api_key + - model_name + title: HuggingfaceConnectionRedactParams + description: Connection parameters specific to huggingface targets + LanguageOptionSchema: properties: - connection_params: + code: + type: string + title: Code + name: + type: string + title: Name + type: object + required: + - code + - name + title: LanguageOptionSchema + description: Language representation with code and display name. + MSCopilotStudioAuthUrlRequestSchema: + properties: + client_id: + type: string + title: Client Id + description: Azure App Registration Client ID + client_secret: + type: string + title: Client Secret + description: Azure App Registration Client Secret + tenant_id: + type: string + title: Tenant Id + description: Azure AD Tenant ID + target_uuid: anyOf: - - $ref: '#/components/schemas/RestConnectionParamsBase-Input' - - $ref: '#/components/schemas/StreamingConnectionParamsBase-Input' + - + type: string + format: uuid - type: 'null' - title: Connection Params - description: API connection parameters (sensitive data masked for security) - network_broker_channel_uuid: + title: Target Uuid + description: Existing target UUID for resolving redacted client_secret on re-auth. + token_json_uuid: anyOf: - - type: string + - + type: string format: uuid - type: 'null' - title: Network Broker Channel Uuid - description: Network broker channel UUID for routing requests. Required - when api_endpoint_type is NETWORK_BROKER. - examples: - - 550e8400-e29b-41d4-a716-446655440000 - name: + title: Token Json Uuid + description: 'Existing token_json_uuid for re-auth. If omitted, a new UUID is generated.' + additionalProperties: false + type: object + required: + - client_id + - client_secret + - tenant_id + title: MSCopilotStudioAuthUrlRequestSchema + description: | + Request body for generating MS Copilot Studio OAuth auth URL (POST /auth-url). + + If token_json_uuid is provided, reuses existing UUID (re-auth). + If omitted, generates a new UUID (new target). + MSCopilotStudioAuthUrlResponseSchema: + properties: + auth_url: type: string - title: Name - description: Target name - examples: - - GPT 4.1 Nano - description: - anyOf: - - type: string - - type: 'null' - title: Description - description: Optional target description - default: null - examples: - - AI model for testing - target_type: - anyOf: - - $ref: '#/components/schemas/TargetType' - - type: 'null' - description: Type of target - connection_type: - anyOf: - - $ref: '#/components/schemas/TargetConnectionType' - - type: 'null' - description: Connection type/provider for the target - examples: - - CUSTOM - - OPENAI - - BEDROCK - api_endpoint_type: - anyOf: - - $ref: '#/components/schemas/ApiEndpointType' - - type: 'null' - description: Accessibility type of the API endpoint - examples: - - PUBLIC - - PRIVATE - - NETWORK_BROKER - response_mode: - anyOf: - - $ref: '#/components/schemas/ResponseMode' - - type: 'null' - description: Response mode for API interactions - examples: - - REST - - STREAMING - session_supported: - type: boolean - title: Session Supported - description: Whether target supports session for multi-turn conversations - default: false - extra_info: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Extra Info - description: Additional configuration or metadata for the target - default: null - examples: - - custom_key: custom_value - target_metadata: - $ref: '#/components/schemas/TargetMetadata' - description: Target metadata and configuration options - target_background: - anyOf: - - $ref: '#/components/schemas/TargetBackground' - - type: 'null' - description: 'Target background: industry, use_case, competitors' - additional_context: - anyOf: - - $ref: '#/components/schemas/TargetAdditionalContext' - - type: 'null' - description: 'Additional context: base_model, system_prompt, languages, - etc.' - uuid: - anyOf: - - type: string - format: uuid - - type: 'null' - title: Uuid - description: Target UUID. If provided, will be returned in response. - probe_fields: - anyOf: - - items: - type: string - type: array - - type: 'null' - title: Probe Fields - description: 'Specific probes to run. If None, runs all probes. Valid: industry, - use_case, competitors, base_model, core_architecture, languages_supported, - tools_accessible, system_prompt, banned_keywords' - additionalProperties: false + title: Auth Url + description: OAuth authorization URL for user login + token_json_uuid: + type: string + format: uuid + title: Token Json Uuid + description: UUID referencing MSAL token cache in GSM + state: + type: string + title: State + description: MSAL-generated state for frontend session tracking (correlate auth callback with original request) type: object required: - - name - title: TargetProbeRequest - description: 'Request to run profiling probes on a target. - - - Inherits all target creation fields (connection params, metadata, etc.) - - If probe_fields is None, runs all 9 probes. Otherwise runs only specified - probes. - - ' - TargetProfileResponse: + - auth_url + - token_json_uuid + - state + title: MSCopilotStudioAuthUrlResponseSchema + description: Response containing the generated OAuth auth URL. + MSCopilotStudioConnectionParams: properties: - target_id: + client_id: type: string - format: uuid - title: Target Id - target_version: - type: integer - title: Target Version - status: + title: Client Id + description: Azure App Registration Client ID + client_secret: type: string - title: Status - target_background: - anyOf: - - $ref: '#/components/schemas/TargetBackground' - - type: 'null' - additional_context: - anyOf: - - $ref: '#/components/schemas/TargetAdditionalContext' - - type: 'null' - other_details: - anyOf: - - $ref: '#/components/schemas/OtherDetails' - - type: 'null' - ai_generated_fields: + title: Client Secret + description: Azure App Registration Client Secret + tenant_id: + type: string + title: Tenant Id + description: Azure AD Tenant ID + schema_name: + type: string + title: Schema Name + description: Copilot Agent schema/identifier + environment_id: + type: string + title: Environment Id + description: Power Platform Environment ID + token_json_uuid: anyOf: - - items: - type: string - type: array + - + type: string + format: uuid - type: 'null' - title: Ai Generated Fields - description: Field names populated by AI profiler (e.g., competitors, base_model, - system_prompt) - profiling_status: + title: Token Json Uuid + description: UUID referencing MSAL token cache in GSM. Set after POST /ms-copilot-studio/token. + token_cache_json: anyOf: - type: string - type: 'null' - title: Profiling Status - description: Status of the profiling workflow + title: Token Cache Json + description: Serialized MSAL token cache. Injected at POST/PUT /target time from standalone GSM record. type: object required: - - target_id - - target_version - - status - title: TargetProfileResponse - description: Combined response for profile view. - TargetRedactSchema: + - client_id + - client_secret + - tenant_id + - schema_name + - environment_id + title: MSCopilotStudioConnectionParams + description: Microsoft Copilot Studio Agent connection parameters. + MSCopilotStudioConnectionRedactParams: properties: - connection_params: + client_id: + type: string + title: Client Id + description: Azure App Registration Client ID + client_secret: + type: string + format: password + title: Client Secret + description: Azure App Registration Client Secret + writeOnly: true + tenant_id: + type: string + title: Tenant Id + description: Azure AD Tenant ID + schema_name: + type: string + title: Schema Name + description: Copilot Agent schema/identifier + environment_id: + type: string + title: Environment Id + description: Power Platform Environment ID + token_json_uuid: anyOf: - - $ref: '#/components/schemas/RestConnectionParamsRedactBase' - - $ref: '#/components/schemas/StreamingConnectionParamsRedactBase' + - + type: string + format: uuid - type: 'null' - title: Connection Params - description: API connection parameters (sensitive data masked for security) - network_broker_channel_uuid: + title: Token Json Uuid + description: UUID referencing MSAL token cache in GSM. Set after POST /ms-copilot-studio/token. + type: object + required: + - client_id + - client_secret + - tenant_id + - schema_name + - environment_id + title: MSCopilotStudioConnectionRedactParams + description: Redacted version with SecretStr for sensitive fields. + MSCopilotStudioTokenRequestSchema: + properties: + auth_response: + additionalProperties: + type: string + type: object + title: Auth Response + description: 'Full redirect query params from Microsoft (code, state, session_state, etc.)' + token_json_uuid: + type: string + format: uuid + title: Token Json Uuid + description: UUID from POST /auth-url response + client_id: + type: string + title: Client Id + description: Azure App Registration Client ID + client_secret: + type: string + title: Client Secret + description: Azure App Registration Client Secret + tenant_id: + type: string + title: Tenant Id + description: Azure AD Tenant ID + target_uuid: anyOf: - - type: string + - + type: string format: uuid - type: 'null' - title: Network Broker Channel Uuid - description: Network broker channel UUID for routing requests. Required - when api_endpoint_type is NETWORK_BROKER. - examples: - - 550e8400-e29b-41d4-a716-446655440000 - uuid: + title: Target Uuid + description: Existing target UUID for resolving redacted client_secret on re-auth. + additionalProperties: false + type: object + required: + - auth_response + - token_json_uuid + - client_id + - client_secret + - tenant_id + title: MSCopilotStudioTokenRequestSchema + description: Request body for exchanging auth code for tokens (POST /token). + MSCopilotStudioTokenResponseSchema: + properties: + token_json_uuid: type: string format: uuid - title: Uuid - tsg_id: + title: Token Json Uuid + description: UUID referencing MSAL token cache in GSM + type: object + required: + - token_json_uuid + title: MSCopilotStudioTokenResponseSchema + description: Response after successful token exchange (POST/PUT /token). + MultiTurnStatefulConfig: + properties: + type: type: string - title: Tsg Id - name: + const: stateful + title: Type + default: stateful + response_id_field: type: string - title: Name - description: Target name + title: Response Id Field + description: 'JSON path to extract session ID from target response (e.g., ''id'' for OpenAI responses API)' examples: - - GPT 4.1 Nano - description: + - id + - conversation_id + - session.id + request_id_field: + type: string + title: Request Id Field + description: 'JSON path to inject session ID in next request (e.g., ''previous_response_id'' for OpenAI)' + examples: + - previous_response_id + - conversation_id + - session_id + type: object + required: + - response_id_field + - request_id_field + title: MultiTurnStatefulConfig + description: | + Configuration for stateful multi-turn targets (session_supported=true). + + Stateful targets maintain conversation state on the server side using session IDs. + The session ID is extracted from responses and injected into subsequent requests. + MultiTurnStatelessConfig: + properties: + type: + type: string + const: stateless + title: Type + default: stateless + assistant_role: anyOf: - type: string - type: 'null' - title: Description - description: Optional target description - default: null + title: Assistant Role + description: 'Role name for assistant messages in conversation history (e.g., ''assistant'', ''bot'', ''model'')' examples: - - AI model for testing - target_type: + - assistant + - bot + - model + - ai + type: object + title: MultiTurnStatelessConfig + description: | + Configuration for stateless multi-turn targets (session_supported=false). + + Stateless targets require the client to maintain and send conversation history. + The assistant_role specifies the role name used for assistant messages in the history. + NativeConnectionParamsBase-Input: + properties: + target_connection_config: anyOf: - - $ref: '#/components/schemas/TargetType' + - $ref: '#/components/schemas/OpenAIConnectionParams' + - $ref: '#/components/schemas/HuggingfaceConnectionParams' + - $ref: '#/components/schemas/DatabricksConnectionParams' + - $ref: '#/components/schemas/BedrockAccessConnectionParams' + - $ref: '#/components/schemas/MSCopilotStudioConnectionParams' - type: 'null' - description: Type of target - connection_type: + title: Target Connection Config + description: Provider-specific connection config + multi_turn_config: anyOf: - - $ref: '#/components/schemas/TargetConnectionType' + - + oneOf: + - $ref: '#/components/schemas/MultiTurnStatefulConfig' + - $ref: '#/components/schemas/MultiTurnStatelessConfig' + discriminator: + propertyName: type + mapping: + stateful: '#/components/schemas/MultiTurnStatefulConfig' + stateless: '#/components/schemas/MultiTurnStatelessConfig' - type: 'null' - description: Connection type/provider for the target - examples: - - CUSTOM - - OPENAI - - BEDROCK - api_endpoint_type: + title: Multi Turn Config + description: Multi-turn config for stateful or stateless target + type: object + title: NativeConnectionParamsBase + description: | + Base connection parameters for native/SDK-based targets (no HTTP endpoint). + + Used for no-code agent platforms like Microsoft Copilot Studio where + interaction is via a provider's client library, not HTTP REST/streaming. + + # TODO: Consider refactoring RestConnectionParamsBase and StreamingConnectionParamsBase + # to share a common base with this class (e.g., extract target_connection_config and + # multi_turn_config into a shared parent). + NativeConnectionParamsBase-Output: + properties: + target_connection_config: anyOf: - - $ref: '#/components/schemas/ApiEndpointType' + - $ref: '#/components/schemas/OpenAIConnectionParams' + - $ref: '#/components/schemas/HuggingfaceConnectionParams' + - $ref: '#/components/schemas/DatabricksConnectionParams' + - $ref: '#/components/schemas/BedrockAccessConnectionParams' + - $ref: '#/components/schemas/MSCopilotStudioConnectionParams' - type: 'null' - description: Accessibility type of the API endpoint - examples: - - PUBLIC - - PRIVATE - - NETWORK_BROKER - response_mode: - anyOf: - - $ref: '#/components/schemas/ResponseMode' - - type: 'null' - description: Response mode for API interactions - examples: - - REST - - STREAMING - session_supported: - type: boolean - title: Session Supported - description: Whether target supports session for multi-turn conversations - default: false - extra_info: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Extra Info - description: Additional configuration or metadata for the target - default: null - examples: - - custom_key: custom_value - status: - $ref: '#/components/schemas/TargetStatus' - description: Target status - active: - type: boolean - title: Active - description: Whether target is active - validated: - type: boolean - title: Validated - description: Whether target is validated - version: - anyOf: - - type: integer - - type: 'null' - title: Version - description: Configuration version reference for encrypted config - secret_version: + title: Target Connection Config + description: Provider-specific connection config + multi_turn_config: anyOf: - - type: string + - + oneOf: + - $ref: '#/components/schemas/MultiTurnStatefulConfig' + - $ref: '#/components/schemas/MultiTurnStatelessConfig' + discriminator: + propertyName: type + mapping: + stateful: '#/components/schemas/MultiTurnStatefulConfig' + stateless: '#/components/schemas/MultiTurnStatelessConfig' - type: 'null' - title: Secret Version - description: Secret Manager version for connection_params. When present, - sensitive connection data is stored in Secret Manager. When None, connection_params - are stored in GCS (legacy). - created_by_user_id: + title: Multi Turn Config + description: Multi-turn config for stateful or stateless target + type: object + title: NativeConnectionParamsBase + description: | + Base connection parameters for native/SDK-based targets (no HTTP endpoint). + + Used for no-code agent platforms like Microsoft Copilot Studio where + interaction is via a provider's client library, not HTTP REST/streaming. + + # TODO: Consider refactoring RestConnectionParamsBase and StreamingConnectionParamsBase + # to share a common base with this class (e.g., extract target_connection_config and + # multi_turn_config into a shared parent). + NativeConnectionParamsRedactBase: + properties: + target_connection_config: anyOf: - - type: string - format: uuid + - $ref: '#/components/schemas/OpenAIConnectionRedactParams' + - $ref: '#/components/schemas/HuggingfaceConnectionRedactParams' + - $ref: '#/components/schemas/DatabricksConnectionRedactParams' + - $ref: '#/components/schemas/BedrockAccessConnectionRedactParams' + - $ref: '#/components/schemas/MSCopilotStudioConnectionRedactParams' - type: 'null' - title: Created By User Id - description: User ID of target creator - updated_by_user_id: + title: Target Connection Config + description: Provider-specific connection config (redacted) + multi_turn_config: anyOf: - - type: string - format: uuid + - + oneOf: + - $ref: '#/components/schemas/MultiTurnStatefulConfig' + - $ref: '#/components/schemas/MultiTurnStatelessConfig' + discriminator: + propertyName: type + mapping: + stateful: '#/components/schemas/MultiTurnStatefulConfig' + stateless: '#/components/schemas/MultiTurnStatelessConfig' - type: 'null' - title: Updated By User Id - description: User ID of last target updater - created_at: - type: string - format: date-time - title: Created At - description: Creation timestamp - updated_at: + title: Multi Turn Config + description: Multi-turn config for stateful or stateless target + type: object + title: NativeConnectionParamsRedactBase + description: Redacted version of NativeConnectionParamsBase. + OAuth2AuthConfig: + properties: + oauth2_token_url: type: string - format: date-time - title: Updated At - description: Last update timestamp - target_metadata: - $ref: '#/components/schemas/TargetMetadata' - description: Target metadata and configuration options - target_background: - anyOf: - - $ref: '#/components/schemas/TargetBackground' - - type: 'null' - description: 'Target background info: industry, use_case, competitors' - profiling_status: - anyOf: - - $ref: '#/components/schemas/ProfilingStatus' - - type: 'null' - description: Status of the profiling workflow - additional_context: - anyOf: - - $ref: '#/components/schemas/TargetAdditionalContext' - - type: 'null' - description: Additional context with source tracking (user + profiler) + title: Oauth2 Token Url + description: OAuth2 token endpoint URL + examples: + - https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token + oauth2_expiry_minutes: + type: integer + minimum: 0.0 + title: Oauth2 Expiry Minutes + description: Token validity in minutes. System refreshes at expiry - 1 min. + default: 60 + oauth2_headers: + additionalProperties: true + type: object + title: Oauth2 Headers + description: HTTP headers for the token request + examples: + - + Authorization: Basic Y2xpZW50X2lkOmNsaWVudF9zZWNyZXQ= + Content-Type: application/x-www-form-urlencoded + oauth2_body_params: + additionalProperties: true + type: object + title: Oauth2 Body Params + description: Body parameters for the token request (nested JSON dict) + examples: + - + client_id: my-client-id + client_secret: my-client-secret + grant_type: client_credentials + scope: api-access + oauth2_token_response_key: + type: string + title: Oauth2 Token Response Key + description: Dot-notation path to token in response JSON + default: access_token + examples: + - access_token + - data.credentials.access_token + oauth2_inject_header: + additionalProperties: + type: string + type: object + title: Oauth2 Inject Header + description: 'Header template with {TOKEN} placeholder' + examples: + - Authorization: 'Bearer {TOKEN}' type: object required: - - uuid - - tsg_id - - name - - status - - active - - validated - - created_at - - updated_at - title: TargetRedactSchema - description: Target redact Schema - TargetResponseSchema: + - oauth2_token_url + - oauth2_inject_header + title: OAuth2AuthConfig + description: OAuth2 client credentials with proactive token refresh. + OAuth2AuthConfigRedact: properties: - uuid: - type: string - format: uuid - title: Uuid - tsg_id: - type: string - title: Tsg Id - name: + oauth2_token_url: type: string - title: Name - description: Target name - examples: - - GPT 4.1 Nano - description: - anyOf: - - type: string - - type: 'null' - title: Description - description: Optional target description - default: null + title: Oauth2 Token Url + description: OAuth2 token endpoint URL examples: - - AI model for testing - target_type: - anyOf: - - $ref: '#/components/schemas/TargetType' - - type: 'null' - description: Type of target - connection_type: - anyOf: - - $ref: '#/components/schemas/TargetConnectionType' - - type: 'null' - description: Connection type/provider for the target + - https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token + oauth2_expiry_minutes: + type: integer + minimum: 0.0 + title: Oauth2 Expiry Minutes + description: Token validity in minutes. System refreshes at expiry - 1 min. + default: 60 + oauth2_headers: + additionalProperties: true + type: object + title: Oauth2 Headers + description: HTTP headers for the token request examples: - - CUSTOM - - OPENAI - - BEDROCK - api_endpoint_type: - anyOf: - - $ref: '#/components/schemas/ApiEndpointType' - - type: 'null' - description: Accessibility type of the API endpoint + - + Authorization: Basic Y2xpZW50X2lkOmNsaWVudF9zZWNyZXQ= + Content-Type: application/x-www-form-urlencoded + oauth2_body_params: + additionalProperties: true + type: object + title: Oauth2 Body Params + description: Body parameters for the token request (nested JSON dict) examples: - - PUBLIC - - PRIVATE - - NETWORK_BROKER - response_mode: - anyOf: - - $ref: '#/components/schemas/ResponseMode' - - type: 'null' - description: Response mode for API interactions + - + client_id: my-client-id + client_secret: my-client-secret + grant_type: client_credentials + scope: api-access + oauth2_token_response_key: + type: string + title: Oauth2 Token Response Key + description: Dot-notation path to token in response JSON + default: access_token examples: - - REST - - STREAMING - session_supported: - type: boolean - title: Session Supported - description: Whether target supports session for multi-turn conversations - default: false - extra_info: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Extra Info - description: Additional configuration or metadata for the target - default: null + - access_token + - data.credentials.access_token + oauth2_inject_header: + additionalProperties: + type: string + type: object + title: Oauth2 Inject Header + description: 'Header template with {TOKEN} placeholder' examples: - - custom_key: custom_value - status: - $ref: '#/components/schemas/TargetStatus' - description: Target status - active: - type: boolean - title: Active - description: Whether target is active - validated: - type: boolean - title: Validated - description: Whether target is validated - version: - anyOf: - - type: integer - - type: 'null' - title: Version - description: Configuration version - secret_version: - anyOf: - - type: string - - type: 'null' - title: Secret Version - description: Secret Manager version for connection_params. When present, - sensitive connection data is stored in Secret Manager. When None, connection_params - are stored in GCS (legacy). - created_by_user_id: - anyOf: - - type: string - format: uuid - - type: 'null' - title: Created By User Id - description: User ID of target creator - updated_by_user_id: - anyOf: - - type: string - format: uuid - - type: 'null' - title: Updated By User Id - description: User ID of last target updater - created_at: + - Authorization: 'Bearer {TOKEN}' + type: object + required: + - oauth2_token_url + - oauth2_inject_header + title: OAuth2AuthConfigRedact + OpenAIConnectionParams: + properties: + api_key: type: string - format: date-time - title: Created At - description: Creation timestamp - updated_at: + title: Api Key + description: OpenAI API key for authentication + examples: + - sk-abxx + model_name: type: string - format: date-time - title: Updated At - description: Last update timestamp - target_metadata: - $ref: '#/components/schemas/TargetMetadata' - description: Target metadata and configuration options - target_background: - anyOf: - - $ref: '#/components/schemas/TargetBackground' - - type: 'null' - description: 'Target background info: industry, use_case, competitors' - profiling_status: - anyOf: - - $ref: '#/components/schemas/ProfilingStatus' - - type: 'null' - description: Status of the profiling workflow - additional_context: - anyOf: - - $ref: '#/components/schemas/TargetAdditionalContext' - - type: 'null' - description: Additional context with source tracking (user + profiler) + title: Model Name + description: OpenAI model name for API requests + examples: + - gpt-4.1-nano type: object required: - - uuid - - tsg_id - - name - - status - - active - - validated - - created_at - - updated_at - title: TargetResponseSchema - TargetSchema: + - api_key + - model_name + title: OpenAIConnectionParams + description: Connection parameters specific to OpenAI targets + OpenAIConnectionRedactParams: properties: - connection_params: - anyOf: - - $ref: '#/components/schemas/RestConnectionParamsBase-Output' - - $ref: '#/components/schemas/StreamingConnectionParamsBase-Output' - - type: 'null' - title: Connection Params - description: API connection parameters (sensitive data masked for security) - network_broker_channel_uuid: - anyOf: - - type: string - format: uuid - - type: 'null' - title: Network Broker Channel Uuid - description: Network broker channel UUID for routing requests. Required - when api_endpoint_type is NETWORK_BROKER. - examples: - - 550e8400-e29b-41d4-a716-446655440000 - uuid: - type: string - format: uuid - title: Uuid - tsg_id: - type: string - title: Tsg Id - name: + api_key: type: string - title: Name - description: Target name - examples: - - GPT 4.1 Nano - description: - anyOf: - - type: string - - type: 'null' - title: Description - description: Optional target description - default: null - examples: - - AI model for testing - target_type: - anyOf: - - $ref: '#/components/schemas/TargetType' - - type: 'null' - description: Type of target - connection_type: - anyOf: - - $ref: '#/components/schemas/TargetConnectionType' - - type: 'null' - description: Connection type/provider for the target - examples: - - CUSTOM - - OPENAI - - BEDROCK - api_endpoint_type: - anyOf: - - $ref: '#/components/schemas/ApiEndpointType' - - type: 'null' - description: Accessibility type of the API endpoint - examples: - - PUBLIC - - PRIVATE - - NETWORK_BROKER - response_mode: - anyOf: - - $ref: '#/components/schemas/ResponseMode' - - type: 'null' - description: Response mode for API interactions + format: password + title: Api Key + description: OpenAI API key for authentication + writeOnly: true examples: - - REST - - STREAMING - session_supported: - type: boolean - title: Session Supported - description: Whether target supports session for multi-turn conversations - default: false - extra_info: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Extra Info - description: Additional configuration or metadata for the target - default: null + - sk-abxx + model_name: + type: string + title: Model Name + description: OpenAI model name for API requests examples: - - custom_key: custom_value - status: - $ref: '#/components/schemas/TargetStatus' - description: Target status - active: - type: boolean - title: Active - description: Whether target is active - validated: - type: boolean - title: Validated - description: Whether target is validated - version: + - gpt-4.1-nano + type: object + required: + - api_key + - model_name + title: OpenAIConnectionRedactParams + description: Connection parameters specific to OpenAI targets + OtherDetails: + properties: + items: + additionalProperties: true + type: object + title: Items + type: object + title: OtherDetails + description: | + Additional profiler discoveries. Read-only key-value pairs. + + Examples: code_execution_capability, internet_access, etc. + OtherDetailsPrettified: + properties: + execution_environment: + additionalProperties: true + type: object + title: Execution Environment + core_architecture_and_identity: + additionalProperties: true + type: object + title: Core Architecture And Identity + tools_and_integrations: + additionalProperties: true + type: object + title: Tools And Integrations + audience_and_governance: + additionalProperties: true + type: object + title: Audience And Governance + performance_and_metrics: + additionalProperties: true + type: object + title: Performance And Metrics + content_policy: + additionalProperties: true + type: object + title: Content Policy + other_discoveries: + additionalProperties: true + type: object + title: Other Discoveries + type: object + title: OtherDetailsPrettified + description: Categorized view of profiler discoveries for FE display. + PaginationSchema: + properties: + total_items: anyOf: - type: integer - type: 'null' - title: Version - description: Configuration version reference for encrypted config - secret_version: - anyOf: - - type: string - - type: 'null' - title: Secret Version - description: Secret Manager version for connection_params. When present, - sensitive connection data is stored in Secret Manager. When None, connection_params - are stored in GCS (legacy). - created_by_user_id: - anyOf: - - type: string - format: uuid - - type: 'null' - title: Created By User Id - description: User ID of target creator - updated_by_user_id: - anyOf: - - type: string - format: uuid - - type: 'null' - title: Updated By User Id - description: User ID of last target updater - created_at: - type: string - format: date-time - title: Created At - description: Creation timestamp - updated_at: - type: string - format: date-time - title: Updated At - description: Last update timestamp - target_metadata: - $ref: '#/components/schemas/TargetMetadata' - description: Target metadata and configuration options - target_background: - anyOf: - - $ref: '#/components/schemas/TargetBackground' - - type: 'null' - description: 'Target background info: industry, use_case, competitors' - profiling_status: - anyOf: - - $ref: '#/components/schemas/ProfilingStatus' - - type: 'null' - description: Status of the profiling workflow - additional_context: - anyOf: - - $ref: '#/components/schemas/TargetAdditionalContext' - - type: 'null' - description: Additional context with source tracking (user + profiler) + title: Total Items type: object - required: - - uuid - - tsg_id - - name - - status - - active - - validated - - created_at - - updated_at - title: TargetSchema - description: 'Target Get Schema with profiling fields. - - - Inherits from TargetDetailSchema which includes: - - - target_background: industry, use_case, competitors - - - profiling_status: INIT, QUEUED, IN_PROGRESS, COMPLETED, FAILED - - - additional_context: merged user + profiler values with source tracking - - ' - TargetStatus: + title: PaginationSchema + ProfilingStatus: type: string enum: - - DRAFT - - VALIDATING - - VALIDATED - - ACTIVE - - INACTIVE + - INIT + - QUEUED + - IN_PROGRESS + - COMPLETED - FAILED - - PENDING_AUTH - title: TargetStatus - description: Status enumeration for scan targets. - TargetType: + - PARTIALLY_COMPLETE + title: ProfilingStatus + description: Status of target profiling workflow. + PromptSetStatsSchema: + properties: + total_prompts: + type: integer + title: Total Prompts + description: Total number of prompts + active_prompts: + type: integer + title: Active Prompts + description: Number of active prompts + failed_prompts: + type: integer + title: Failed Prompts + description: Number of failed prompts + default: 0 + validation_prompts: + type: integer + title: Validation Prompts + description: Number of validation prompts + default: 0 + inactive_prompts: + type: integer + title: Inactive Prompts + description: Number of inactive prompts + type: object + required: + - total_prompts + - active_prompts + - inactive_prompts + title: PromptSetStatsSchema + description: Schema for prompt set statistics. + PropertyAssignmentSchema: + properties: + property_name: + type: string + title: Property Name + description: 'Property name (e.g., ''industry'', ''role'')' + property_value: + type: string + title: Property Value + description: 'Property value (e.g., ''healthcare'', ''CEO'')' + type: object + required: + - property_name + - property_value + title: PropertyAssignmentSchema + description: Schema for property name-value assignments. + PropertyDefinitionSchema: + properties: + property_name: + type: string + title: Property Name + description: Property name + created_at: + type: string + format: date-time + title: Created At + description: When the property was created + type: object + required: + - property_name + - created_at + title: PropertyDefinitionSchema + description: Schema for property definitions in a prompt set. + PropertyNameCreateRequestSchema: + properties: + name: + type: string + maxLength: 256 + title: Name + description: Name of the property + additionalProperties: false + type: object + required: + - name + title: PropertyNameCreateRequestSchema + description: Schema for creating a new property name. + PropertyNamesListResponseSchema: + properties: + data: + items: + type: string + type: array + title: Data + description: List of property names + type: object + title: PropertyNamesListResponseSchema + description: Schema for property names list responses. + PropertyValueCreateRequestSchema: + properties: + property_name: + type: string + title: Property Name + description: Name of the property + property_value: + type: string + maxLength: 256 + title: Property Value + description: Value for the property + additionalProperties: false + type: object + required: + - property_name + - property_value + title: PropertyValueCreateRequestSchema + description: Schema for creating a new property value. + PropertyValuesMultipleResponseSchema: + properties: + data: + additionalProperties: + items: + type: string + type: array + type: object + title: Data + description: Dictionary mapping property names to their values + type: object + title: PropertyValuesMultipleResponseSchema + description: Schema for property values for multiple property names. + PropertyValuesResponseSchema: + properties: + name: + type: string + title: Name + description: Property name + values: + items: + type: string + type: array + title: Values + description: List of values for this property + type: object + required: + - name + title: PropertyValuesResponseSchema + description: Schema for property values for a specific property name. + ResponseMode: type: string enum: - - APPLICATION - - AGENT - - MODEL - title: TargetType - description: Target Types Available - TargetUpdateRequestSchema: + - REST + - STREAMING + - WEBSOCKET + - WEBSOCKET_STREAMING + title: ResponseMode + description: Response mode for target interactions. + RestConnectionParamsBase-Input: properties: - connection_params: - anyOf: - - $ref: '#/components/schemas/RestConnectionParamsBase-Input' - - $ref: '#/components/schemas/StreamingConnectionParamsBase-Input' - - type: 'null' - title: Connection Params - description: API connection parameters (sensitive data masked for security) - network_broker_channel_uuid: + api_endpoint: anyOf: - type: string - format: uuid - type: 'null' - title: Network Broker Channel Uuid - description: Network broker channel UUID for routing requests. Required - when api_endpoint_type is NETWORK_BROKER. + title: Api Endpoint + description: API endpoint URL examples: - - 550e8400-e29b-41d4-a716-446655440000 - name: - type: string - title: Name - description: Target name + - https://api.openai.com/v1/responses + request_headers: + additionalProperties: true + type: object + title: Request Headers + description: Request headers + default: {} examples: - - GPT 4.1 Nano - description: - anyOf: - - type: string - - type: 'null' - title: Description - description: Optional target description - default: null + - + Authorization: Bearer sk-xxx + Content-Type: application/json + request_json: + additionalProperties: true + type: object + title: Request Json + description: Request JSON + default: {} examples: - - AI model for testing - target_type: + - + input: + - + content: + - + text: '{INPUT}' + type: input_text + role: user + model: gpt-4.1-nano + response_json: + additionalProperties: true + type: object + title: Response Json + description: Response JSON + default: {} + examples: + - content: '{RESPONSE}' + response_key: + type: string + title: Response Key + description: Response key + default: + examples: + - content + target_connection_config: anyOf: - - $ref: '#/components/schemas/TargetType' + - $ref: '#/components/schemas/OpenAIConnectionParams' + - $ref: '#/components/schemas/HuggingfaceConnectionParams' + - $ref: '#/components/schemas/DatabricksConnectionParams' + - $ref: '#/components/schemas/BedrockAccessConnectionParams' + - $ref: '#/components/schemas/MSCopilotStudioConnectionParams' - type: 'null' - description: Type of target - connection_type: + title: Target Connection Config + description: Target Connection config of type openai/huggingface .. + curl: anyOf: - - $ref: '#/components/schemas/TargetConnectionType' + - type: string - type: 'null' - description: Connection type/provider for the target + title: Curl + description: Generated cURL command ready to use (redacted for security) examples: - - CUSTOM - - OPENAI - - BEDROCK - api_endpoint_type: + - 'curl "https://api.openai.com/v1/chat/completions" -H "Content-Type: application/json" -H "Authorization: Bearer ***" -d ''{"model":"gpt-4","messages":[{"role":"user","content":"{INPUT}"}]}''' + multi_turn_config: anyOf: - - $ref: '#/components/schemas/ApiEndpointType' + - + oneOf: + - $ref: '#/components/schemas/MultiTurnStatefulConfig' + - $ref: '#/components/schemas/MultiTurnStatelessConfig' + discriminator: + propertyName: type + mapping: + stateful: '#/components/schemas/MultiTurnStatefulConfig' + stateless: '#/components/schemas/MultiTurnStatelessConfig' - type: 'null' - description: Accessibility type of the API endpoint + title: Multi Turn Config + description: Multi turn config for stateful or stateless target examples: - - PUBLIC - - PRIVATE - - NETWORK_BROKER - response_mode: + - 'assistant_role: assistant' + type: object + title: RestConnectionParamsBase + description: Base connection parameters without generated fields. + RestConnectionParamsBase-Output: + properties: + api_endpoint: anyOf: - - $ref: '#/components/schemas/ResponseMode' + - type: string - type: 'null' - description: Response mode for API interactions + title: Api Endpoint + description: API endpoint URL examples: - - REST - - STREAMING - session_supported: - type: boolean - title: Session Supported - description: Whether target supports session for multi-turn conversations - default: false - extra_info: + - https://api.openai.com/v1/responses + request_headers: + additionalProperties: true + type: object + title: Request Headers + description: Request headers + default: {} + examples: + - + Authorization: Bearer sk-xxx + Content-Type: application/json + request_json: + additionalProperties: true + type: object + title: Request Json + description: Request JSON + default: {} + examples: + - + input: + - + content: + - + text: '{INPUT}' + type: input_text + role: user + model: gpt-4.1-nano + response_json: + additionalProperties: true + type: object + title: Response Json + description: Response JSON + default: {} + examples: + - content: '{RESPONSE}' + response_key: + type: string + title: Response Key + description: Response key + default: + examples: + - content + target_connection_config: anyOf: - - additionalProperties: true - type: object + - $ref: '#/components/schemas/OpenAIConnectionParams' + - $ref: '#/components/schemas/HuggingfaceConnectionParams' + - $ref: '#/components/schemas/DatabricksConnectionParams' + - $ref: '#/components/schemas/BedrockAccessConnectionParams' + - $ref: '#/components/schemas/MSCopilotStudioConnectionParams' - type: 'null' - title: Extra Info - description: Additional configuration or metadata for the target - default: null - examples: - - custom_key: custom_value - target_metadata: - $ref: '#/components/schemas/TargetMetadata' - description: Target metadata and configuration options - target_background: + title: Target Connection Config + description: Target Connection config of type openai/huggingface .. + curl: anyOf: - - $ref: '#/components/schemas/TargetBackground' + - type: string - type: 'null' - description: 'Target background: industry, use_case, competitors' - additional_context: + title: Curl + description: Generated cURL command ready to use (redacted for security) + examples: + - 'curl "https://api.openai.com/v1/chat/completions" -H "Content-Type: application/json" -H "Authorization: Bearer ***" -d ''{"model":"gpt-4","messages":[{"role":"user","content":"{INPUT}"}]}''' + multi_turn_config: anyOf: - - $ref: '#/components/schemas/TargetAdditionalContext' + - + oneOf: + - $ref: '#/components/schemas/MultiTurnStatefulConfig' + - $ref: '#/components/schemas/MultiTurnStatelessConfig' + discriminator: + propertyName: type + mapping: + stateful: '#/components/schemas/MultiTurnStatefulConfig' + stateless: '#/components/schemas/MultiTurnStatelessConfig' - type: 'null' - description: 'Additional context: base_model, system_prompt, languages, - etc.' - additionalProperties: false + title: Multi Turn Config + description: Multi turn config for stateful or stateless target + examples: + - 'assistant_role: assistant' type: object - required: - - name - title: TargetUpdateRequestSchema - description: Schema for both create and update operations. - ValidationError: + title: RestConnectionParamsBase + description: Base connection parameters without generated fields. + RestConnectionParamsRedactBase: properties: - loc: - items: - anyOf: - - type: string - - type: integer - type: array - title: Location - msg: - type: string - title: Message - type: + api_endpoint: + anyOf: + - type: string + - type: 'null' + title: Api Endpoint + description: API endpoint URL + examples: + - https://api.openai.com/v1/responses + request_headers: + additionalProperties: true + type: object + title: Request Headers + description: Request headers + default: {} + examples: + - + Authorization: Bearer sk-xxx + Content-Type: application/json + request_json: + additionalProperties: true + type: object + title: Request Json + description: Request JSON + default: {} + examples: + - + input: + - + content: + - + text: '{INPUT}' + type: input_text + role: user + model: gpt-4.1-nano + response_json: + additionalProperties: true + type: object + title: Response Json + description: Response JSON + default: {} + examples: + - content: '{RESPONSE}' + response_key: type: string - title: Error Type - type: object - required: - - loc - - msg - - type - title: ValidationError -ExternalTags: - CustomAttack: - title: CustomAttack - description: Operations for managing custom prompt sets, prompts, and properties. - tags: - - CustomAttack - Dashboard: - title: Dashboard - description: Operations for retrieving dashboard overview and statistics. - tags: - - Dashboard - HealthChecks: - title: HealthChecks - description: Operations related to health checks of the management plane service. - tags: - - HealthChecks - Target: - title: Target - description: Operations for managing scan targets (create, update, delete, list). - tags: - - Target -paths: - /ready: - get: - summary: Readiness - description: Retrieve the ready details through this Application Programming - Interface endpoint. - operationId: readiness_ready_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - title: Response Readiness Ready Get - 401: - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: [] - tags: - - HealthChecks - /liveness: - get: - summary: Liveness - description: Retrieve the liveness details through this Application Programming - Interface endpoint. - operationId: liveness_liveness_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - additionalProperties: - type: boolean - type: object - title: Response Liveness Liveness Get - 401: - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: [] - tags: - - HealthChecks - /v1/target: - post: - summary: Create target - description: Create a new scan target. - operationId: create_target_v1_target_post - responses: - 201: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/TargetResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: validate - in: query - required: false - schema: - type: boolean - description: Whether to validate target configuration + title: Response Key + description: Response key + default: examples: - - true - title: Validate - description: Whether to validate target configuration - tags: - - Target - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/TargetCreateRequestSchema' - get: - summary: List targets - description: List all scan targets with pagination and filtering support. - operationId: list_targets_v1_target_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/TargetListSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: skip - in: query - required: false - schema: - type: integer - minimum: 0 - description: Number of records to skip - default: 0 - title: Skip - description: Number of records to skip - - name: limit - in: query - required: false - schema: - type: integer - maximum: 100 - minimum: 1 - description: Maximum records to return - default: 10 - title: Limit - description: Maximum records to return - - name: target_type - in: query - required: false - schema: + - content + target_connection_config: anyOf: - - $ref: '#/components/schemas/TargetType' + - $ref: '#/components/schemas/OpenAIConnectionRedactParams' + - $ref: '#/components/schemas/HuggingfaceConnectionRedactParams' + - $ref: '#/components/schemas/DatabricksConnectionRedactParams' + - $ref: '#/components/schemas/BedrockAccessConnectionRedactParams' + - $ref: '#/components/schemas/MSCopilotStudioConnectionRedactParams' - type: 'null' - description: Filter by target type - title: Target Type - description: Filter by target type - - name: status - in: query - required: false - schema: + title: Target Connection Config + description: Target Connection config of type openai/huggingface .. + curl: anyOf: - - $ref: '#/components/schemas/TargetStatus' + - type: string - type: 'null' - description: Filter by status - title: Status - description: Filter by status - - name: search - in: query - required: false - schema: + title: Curl + description: Generated cURL command ready to use (redacted for security) + examples: + - 'curl "https://api.openai.com/v1/chat/completions" -H "Content-Type: application/json" -H "Authorization: Bearer ***" -d ''{"model":"gpt-4","messages":[{"role":"user","content":"{INPUT}"}]}''' + multi_turn_config: + anyOf: + - + oneOf: + - $ref: '#/components/schemas/MultiTurnStatefulConfig' + - $ref: '#/components/schemas/MultiTurnStatelessConfig' + discriminator: + propertyName: type + mapping: + stateful: '#/components/schemas/MultiTurnStatefulConfig' + stateless: '#/components/schemas/MultiTurnStatelessConfig' + - type: 'null' + title: Multi Turn Config + description: Multi turn config for stateful or stateless target + examples: + - 'assistant_role: assistant' + type: object + title: RestConnectionParamsRedactBase + StartProfilingResponseSchema: + properties: + message: + type: string + title: Message + description: Status message + type: object + required: + - message + title: StartProfilingResponseSchema + description: Response schema for start profiling action. + StreamingConnectionParamsBase-Input: + properties: + api_endpoint: anyOf: - type: string - type: 'null' - description: Search target by name - title: Search - description: Search target by name - tags: - - Target - /v1/target/{target_uuid}: - get: - summary: Get target details - description: Retrieve a specific target by UUID with complete configuration - details and masked connection parameters. - operationId: get_target_v1_target__target_uuid__get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/TargetRedactSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: target_uuid - in: path - required: true - schema: + title: Api Endpoint + description: API endpoint URL + examples: + - https://api.openai.com/v1/responses + request_headers: + additionalProperties: true + type: object + title: Request Headers + description: Request headers + default: {} + examples: + - + Authorization: Bearer sk-xxx + Content-Type: application/json + request_json: + additionalProperties: true + type: object + title: Request Json + description: Request JSON + default: {} + examples: + - + input: + - + content: + - + text: '{INPUT}' + type: input_text + role: user + model: gpt-4.1-nano + response_json: + additionalProperties: true + type: object + title: Response Json + description: Response JSON + default: {} + examples: + - content: '{RESPONSE}' + response_key: type: string - format: uuid - title: Target Uuid - tags: - - Target - put: - summary: Update target - description: Update an existing target with new configuration and optional validation - control. - operationId: update_target_v1_target__target_uuid__put - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/TargetSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: target_uuid - in: path - required: true - schema: + title: Response Key + description: Response key + default: + examples: + - content + target_connection_config: + anyOf: + - $ref: '#/components/schemas/OpenAIConnectionParams' + - $ref: '#/components/schemas/HuggingfaceConnectionParams' + - $ref: '#/components/schemas/DatabricksConnectionParams' + - $ref: '#/components/schemas/BedrockAccessConnectionParams' + - $ref: '#/components/schemas/MSCopilotStudioConnectionParams' + - type: 'null' + title: Target Connection Config + description: Target Connection config of type openai/huggingface .. + curl: + anyOf: + - type: string + - type: 'null' + title: Curl + description: Generated cURL command ready to use (redacted for security) + examples: + - 'curl "https://api.openai.com/v1/chat/completions" -H "Content-Type: application/json" -H "Authorization: Bearer ***" -d ''{"model":"gpt-4","messages":[{"role":"user","content":"{INPUT}"}]}''' + multi_turn_config: + anyOf: + - + oneOf: + - $ref: '#/components/schemas/MultiTurnStatefulConfig' + - $ref: '#/components/schemas/MultiTurnStatelessConfig' + discriminator: + propertyName: type + mapping: + stateful: '#/components/schemas/MultiTurnStatefulConfig' + stateless: '#/components/schemas/MultiTurnStatelessConfig' + - type: 'null' + title: Multi Turn Config + description: Multi turn config for stateful or stateless target + examples: + - 'assistant_role: assistant' + response_stop_key: type: string - format: uuid - title: Target Uuid - - name: validate - in: query - required: false - schema: - type: boolean - description: Whether to validate target configuration - default: true - title: Validate - description: Whether to validate target configuration - tags: - - Target - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/TargetUpdateRequestSchema' - delete: - summary: Delete target - description: Permanently delete a target and its encrypted configuration data. - operationId: delete_target_v1_target__target_uuid__delete - responses: - 204: - description: Successful Response - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: target_uuid - in: path - required: true - schema: + title: Response Stop Key + response_stop_value: type: string - format: uuid - title: Target Uuid - tags: - - Target - /v1/target/{target_uuid}/profile: - put: - summary: Update target profile - description: Update target background and additional context fields without - connection validation. - operationId: update_target_profile_v1_target__target_uuid__profile_put - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/TargetSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: target_uuid - in: path - required: true - schema: + title: Response Stop Value + type: object + required: + - response_stop_key + - response_stop_value + title: StreamingConnectionParamsBase + description: Base streaming connection parameters without generated fields. + StreamingConnectionParamsBase-Output: + properties: + api_endpoint: + anyOf: + - type: string + - type: 'null' + title: Api Endpoint + description: API endpoint URL + examples: + - https://api.openai.com/v1/responses + request_headers: + additionalProperties: true + type: object + title: Request Headers + description: Request headers + default: {} + examples: + - + Authorization: Bearer sk-xxx + Content-Type: application/json + request_json: + additionalProperties: true + type: object + title: Request Json + description: Request JSON + default: {} + examples: + - + input: + - + content: + - + text: '{INPUT}' + type: input_text + role: user + model: gpt-4.1-nano + response_json: + additionalProperties: true + type: object + title: Response Json + description: Response JSON + default: {} + examples: + - content: '{RESPONSE}' + response_key: type: string - format: uuid - title: Target Uuid - tags: - - Target - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/TargetContextUpdateSchema' - get: - summary: Get profiling results - description: Get profiling results including merged user and profiler data. - operationId: get_profiling_results_v1_target__target_uuid__profile_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/TargetProfileResponse' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: target_uuid - in: path - required: true - schema: - type: string - format: uuid - title: Target Uuid - tags: - - Target - /v1/target/probe: - post: - summary: Run profiling probes on target - description: Send profiling questions to a target using provided connection - parameters. Returns TargetResponseSchema with target_background and additional_context - populated from probe responses. - operationId: run_target_probes_v1_target_probe_post - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/TargetResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: [] - tags: - - Target - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/TargetProbeRequest' - required: true - /v1/custom-attack/custom-prompt-set: - post: - summary: Create a new custom prompt set - description: Create a new custom prompt set. - operationId: create_prompt_set_v1_custom_attack_custom_prompt_set_post - responses: - 201: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/CustomPromptSetResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: [] - tags: - - CustomAttack - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CustomPromptSetCreateRequestSchema' - required: true - /v1/custom-attack/list-custom-prompt-sets: - get: - summary: List custom prompt sets - description: List all custom prompt sets with pagination and filtering support. - operationId: list_prompt_sets_v1_custom_attack_list_custom_prompt_sets_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/CustomPromptSetListSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: skip - in: query - required: false - schema: - type: integer - minimum: 0 - description: Number of records to skip - default: 0 - title: Skip - description: Number of records to skip - - name: limit - in: query - required: false - schema: - type: integer - maximum: 100 - minimum: 1 - description: Maximum records to return - default: 10 - title: Limit - description: Maximum records to return - - name: status - in: query - required: false - schema: + title: Response Key + description: Response key + default: + examples: + - content + target_connection_config: anyOf: - - type: string + - $ref: '#/components/schemas/OpenAIConnectionParams' + - $ref: '#/components/schemas/HuggingfaceConnectionParams' + - $ref: '#/components/schemas/DatabricksConnectionParams' + - $ref: '#/components/schemas/BedrockAccessConnectionParams' + - $ref: '#/components/schemas/MSCopilotStudioConnectionParams' - type: 'null' - description: Filter by status - title: Status - description: Filter by status - - name: active - in: query - required: false - schema: + title: Target Connection Config + description: Target Connection config of type openai/huggingface .. + curl: anyOf: - - type: boolean + - type: string - type: 'null' - description: Filter by active status - title: Active - description: Filter by active status - - name: archive - in: query - required: false - schema: + title: Curl + description: Generated cURL command ready to use (redacted for security) + examples: + - 'curl "https://api.openai.com/v1/chat/completions" -H "Content-Type: application/json" -H "Authorization: Bearer ***" -d ''{"model":"gpt-4","messages":[{"role":"user","content":"{INPUT}"}]}''' + multi_turn_config: anyOf: - - type: boolean + - + oneOf: + - $ref: '#/components/schemas/MultiTurnStatefulConfig' + - $ref: '#/components/schemas/MultiTurnStatelessConfig' + discriminator: + propertyName: type + mapping: + stateful: '#/components/schemas/MultiTurnStatefulConfig' + stateless: '#/components/schemas/MultiTurnStatelessConfig' - type: 'null' - description: Filter by archive status (None=non-archived only, True=archived - only, False=non-archived only) - title: Archive - description: Filter by archive status (None=non-archived only, True=archived - only, False=non-archived only) - - name: search - in: query - required: false - schema: + title: Multi Turn Config + description: Multi turn config for stateful or stateless target + examples: + - 'assistant_role: assistant' + response_stop_key: + type: string + title: Response Stop Key + response_stop_value: + type: string + title: Response Stop Value + type: object + required: + - response_stop_key + - response_stop_value + title: StreamingConnectionParamsBase + description: Base streaming connection parameters without generated fields. + StreamingConnectionParamsRedactBase: + properties: + api_endpoint: anyOf: - type: string - type: 'null' - description: Search in name and description - title: Search - description: Search in name and description - tags: - - CustomAttack - /v1/custom-attack/custom-prompt-set/{prompt_set_uuid}: - get: - summary: Get prompt set details - description: Retrieve a specific prompt set by UUID with complete details including - properties. - operationId: get_prompt_set_v1_custom_attack_custom_prompt_set__prompt_set_uuid__get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/CustomPromptSetResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: prompt_set_uuid - in: path - required: true - schema: + title: Api Endpoint + description: API endpoint URL + examples: + - https://api.openai.com/v1/responses + request_headers: + additionalProperties: true + type: object + title: Request Headers + description: Request headers + default: {} + examples: + - + Authorization: Bearer sk-xxx + Content-Type: application/json + request_json: + additionalProperties: true + type: object + title: Request Json + description: Request JSON + default: {} + examples: + - + input: + - + content: + - + text: '{INPUT}' + type: input_text + role: user + model: gpt-4.1-nano + response_json: + additionalProperties: true + type: object + title: Response Json + description: Response JSON + default: {} + examples: + - content: '{RESPONSE}' + response_key: type: string - format: uuid - title: Prompt Set Uuid - tags: - - CustomAttack - put: - summary: Update prompt set - description: Update prompt set details including name, description, and properties. - operationId: update_prompt_set_v1_custom_attack_custom_prompt_set__prompt_set_uuid__put - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/CustomPromptSetResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: prompt_set_uuid - in: path - required: true - schema: - type: string - format: uuid - title: Prompt Set Uuid - tags: - - CustomAttack - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CustomPromptSetUpdateRequestSchema' - /v1/custom-attack/custom-prompt-set/{prompt_set_uuid}/archive: - put: - summary: Archive or unarchive a prompt set - description: Archive or unarchive a prompt set to manage its lifecycle. - operationId: archive_prompt_set_v1_custom_attack_custom_prompt_set__prompt_set_uuid__archive_put - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/CustomPromptSetResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: prompt_set_uuid - in: path - required: true - schema: + title: Response Key + description: Response key + default: + examples: + - content + target_connection_config: + anyOf: + - $ref: '#/components/schemas/OpenAIConnectionRedactParams' + - $ref: '#/components/schemas/HuggingfaceConnectionRedactParams' + - $ref: '#/components/schemas/DatabricksConnectionRedactParams' + - $ref: '#/components/schemas/BedrockAccessConnectionRedactParams' + - $ref: '#/components/schemas/MSCopilotStudioConnectionRedactParams' + - type: 'null' + title: Target Connection Config + description: Target Connection config of type openai/huggingface .. + curl: + anyOf: + - type: string + - type: 'null' + title: Curl + description: Generated cURL command ready to use (redacted for security) + examples: + - 'curl "https://api.openai.com/v1/chat/completions" -H "Content-Type: application/json" -H "Authorization: Bearer ***" -d ''{"model":"gpt-4","messages":[{"role":"user","content":"{INPUT}"}]}''' + multi_turn_config: + anyOf: + - + oneOf: + - $ref: '#/components/schemas/MultiTurnStatefulConfig' + - $ref: '#/components/schemas/MultiTurnStatelessConfig' + discriminator: + propertyName: type + mapping: + stateful: '#/components/schemas/MultiTurnStatefulConfig' + stateless: '#/components/schemas/MultiTurnStatelessConfig' + - type: 'null' + title: Multi Turn Config + description: Multi turn config for stateful or stateless target + examples: + - 'assistant_role: assistant' + response_stop_key: type: string - format: uuid - title: Prompt Set Uuid - tags: - - CustomAttack - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CustomPromptSetArchiveRequestSchema' - /v1/custom-attack/custom-prompt-set/custom-prompt: - post: - summary: Create prompt in a prompt set - description: Create a new prompt in a prompt set. - operationId: create_prompt_v1_custom_attack_custom_prompt_set_custom_prompt_post - responses: - 201: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/CustomPromptResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: [] - tags: - - CustomAttack - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CustomPromptCreateRequestSchema' - required: true - /v1/custom-attack/custom-prompt-set/{prompt_set_uuid}/list-custom-prompts: - get: - summary: List prompts in a prompt set - description: List all prompts within a specific prompt set with pagination and - filtering. - operationId: list_prompts_in_set_v1_custom_attack_custom_prompt_set__prompt_set_uuid__list_custom_prompts_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/CustomPromptListSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: prompt_set_uuid - in: path - required: true - schema: + title: Response Stop Key + response_stop_value: type: string - format: uuid - title: Prompt Set Uuid - - name: skip - in: query - required: false - schema: - type: integer - minimum: 0 - description: Number of records to skip - default: 0 - title: Skip - description: Number of records to skip - - name: limit - in: query - required: false - schema: - type: integer - maximum: 100 - minimum: 1 - description: Maximum records to return - default: 10 - title: Limit - description: Maximum records to return - - name: status - in: query - required: false - schema: + title: Response Stop Value + type: object + required: + - response_stop_key + - response_stop_value + title: StreamingConnectionParamsRedactBase + SupportedLanguage: + type: string + enum: + - ar + - bn + - zh-CN + - zh-TW + - nl + - en + - fr + - de + - hi + - id + - it + - ja + - ko + - pl + - pt + - ru + - es + - sv + - th + - tr + - vi + title: SupportedLanguage + TargetAdditionalContext: + properties: + base_model: anyOf: - type: string - type: 'null' - description: Filter by status - title: Status - description: Filter by status - - name: active - in: query - required: false - schema: + title: Base Model + description: 'Base model name (e.g., GPT-4, Claude)' + core_architecture: anyOf: - - type: boolean + - type: string - type: 'null' - description: Filter by active status - title: Active - description: Filter by active status - - name: search - in: query - required: false - schema: + title: Core Architecture + description: Core architecture details + system_prompt: anyOf: - type: string - type: 'null' - description: Search in prompt text - title: Search - description: Search in prompt text - tags: - - CustomAttack - /v1/custom-attack/custom-prompt-set/{prompt_set_uuid}/custom-prompt/{prompt_uuid}: - get: - summary: Get prompt details - description: Get a specific prompt by UUID. - operationId: get_prompt_v1_custom_attack_custom_prompt_set__prompt_set_uuid__custom_prompt__prompt_uuid__get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/CustomPromptResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: prompt_set_uuid - in: path - required: true - schema: - type: string - format: uuid - title: Prompt Set Uuid - - name: prompt_uuid - in: path - required: true - schema: - type: string - format: uuid - title: Prompt Uuid - tags: - - CustomAttack - put: - summary: Update prompt - description: Update an existing prompt. - operationId: update_prompt_v1_custom_attack_custom_prompt_set__prompt_set_uuid__custom_prompt__prompt_uuid__put - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/CustomPromptResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: prompt_set_uuid - in: path - required: true - schema: - type: string - format: uuid - title: Prompt Set Uuid - - name: prompt_uuid - in: path - required: true - schema: - type: string - format: uuid - title: Prompt Uuid - tags: - - CustomAttack - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CustomPromptUpdateRequestSchema' - delete: - summary: Delete prompt - description: Delete a prompt. - operationId: delete_prompt_v1_custom_attack_custom_prompt_set__prompt_set_uuid__custom_prompt__prompt_uuid__delete - responses: - 204: - description: Successful Response - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: prompt_set_uuid - in: path - required: true - schema: + title: System Prompt + description: System prompt + languages_supported: + anyOf: + - + items: + type: string + type: array + - type: 'null' + title: Languages Supported + description: Supported languages + banned_keywords: + anyOf: + - + items: + type: string + type: array + - type: 'null' + title: Banned Keywords + description: Banned keywords/phrases + tools_accessible: + anyOf: + - + items: + type: string + type: array + - type: 'null' + title: Tools Accessible + description: Accessible tools/capabilities + type: object + title: TargetAdditionalContext + description: | + Additional context - used in create/update API requests and stored in DB/GCS. + + Single value fields are strings. + List fields are lists of strings. + TargetAuthValidationRequestSchema: + properties: + auth_type: + $ref: '#/components/schemas/red_team_shared__schemas__auth_config__AuthType' + description: Authentication method type + auth_config: + anyOf: + - $ref: '#/components/schemas/HeadersAuthConfig' + - $ref: '#/components/schemas/BasicAuthAuthConfig' + - $ref: '#/components/schemas/OAuth2AuthConfig' + title: Auth Config + description: Authentication configuration to validate + target_id: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Target Id + description: 'Existing target UUID. When provided and auth_config contains redacted values, actual credentials are fetched from secrets manager.' + network_broker_channel_uuid: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Network Broker Channel Uuid + description: 'Network broker channel UUID. When provided, OAuth2 token requests are routed via network broker.' + type: object + required: + - auth_type + - auth_config + title: TargetAuthValidationRequestSchema + description: Request schema to validate target authentication configuration. + TargetAuthValidationResponseSchema: + properties: + validated: + type: boolean + title: Validated + description: Whether auth validation passed + token_preview: + anyOf: + - type: string + - type: 'null' + title: Token Preview + description: First 20 chars of token (OAuth2 only) + expires_in: + anyOf: + - type: integer + - type: 'null' + title: Expires In + description: Token expiry from response (OAuth2 only) + type: object + required: + - validated + title: TargetAuthValidationResponseSchema + description: | + Response schema from target authentication validation. + + On failure, the service raises airs_common exceptions (ValidationError, + AuthError, etc.) which are converted to HTTP error responses by middleware. + TargetBackground: + properties: + industry: + anyOf: + - type: string + - type: 'null' + title: Industry + description: 'Target''s industry (e.g., Healthcare, Finance)' + use_case: + anyOf: + - type: string + - type: 'null' + title: Use Case + description: 'Primary use case (e.g., Customer Support, Code Assistant)' + competitors: + anyOf: + - + items: + type: string + type: array + - type: 'null' + title: Competitors + description: Known competitor products + agentic_profiling_enabled: + type: boolean + title: Agentic Profiling Enabled + description: Whether agentic profiling is enabled for this target + default: true + type: object + title: TargetBackground + description: | + Target background - used in create/update API requests and stored in DB/GCS. + + Required fields for activation: + - industry (string, required) + - use_case (string, required) + + Optional field: + - competitors (list of strings) + TargetConnectionType: + type: string + enum: + - DATABRICKS + - BEDROCK + - OPENAI + - HUGGING_FACE + - CUSTOM + - REST + - STREAMING + - WEBSOCKET + - WEBSOCKET_STREAMING + - MS_COPILOT_STUDIO + title: TargetConnectionType + description: Connection type/provider for the target. + TargetContextUpdateSchema: + properties: + target_background: + anyOf: + - $ref: '#/components/schemas/TargetBackground' + - type: 'null' + description: 'Target background: industry, use_case, competitors' + additional_context: + anyOf: + - $ref: '#/components/schemas/TargetAdditionalContext' + - type: 'null' + description: 'Additional context: base_model, system_prompt, languages, etc.' + type: object + title: TargetContextUpdateSchema + description: | + Request schema for updating target profile (background + additional context). + + Used by PUT /{target_uuid}/profile endpoint. + User provides plain values which are saved directly to DB and GCS. + TargetCreateRequestSchema: + properties: + connection_params: + anyOf: + - oneOf: + - $ref: '#/components/schemas/NativeConnectionParamsBase-Input' + - $ref: '#/components/schemas/WebSocketConnectionParamsBase-Input' + - $ref: '#/components/schemas/StreamingConnectionParamsBase-Input' + - $ref: '#/components/schemas/RestConnectionParamsBase-Input' + - type: 'null' + title: Connection Params + description: API connection parameters (sensitive data masked for security) + examples: + - + api_endpoint: https://api.openai.com/v1/responses + request_headers: + Authorization: Bearer sk-xxx + Content-Type: application/json + request_json: + input: + - + content: + - + text: '{INPUT}' + type: input_text + role: user + model: gpt-4.1-nano + response_json: + content: '{RESPONSE}' + response_key: content + auth_config: + anyOf: + - $ref: '#/components/schemas/HeadersAuthConfig' + - $ref: '#/components/schemas/BasicAuthAuthConfig' + - $ref: '#/components/schemas/OAuth2AuthConfig' + - type: 'null' + title: Auth Config + description: Authentication configuration (resolved based on auth_type) + network_broker_channel_uuid: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Network Broker Channel Uuid + description: Network broker channel UUID for routing requests. Required when api_endpoint_type is NETWORK_BROKER. + examples: + - 550e8400-e29b-41d4-a716-446655440000 + name: type: string - format: uuid - title: Prompt Set Uuid - - name: prompt_uuid - in: path - required: true - schema: + title: Name + description: Target name + examples: + - GPT 4.1 Nano + description: + anyOf: + - type: string + - type: 'null' + title: Description + description: Optional target description + default: + examples: + - AI model for testing + target_type: + anyOf: + - $ref: '#/components/schemas/TargetType' + - type: 'null' + description: Type of target + connection_type: + anyOf: + - $ref: '#/components/schemas/TargetConnectionType' + - type: 'null' + description: Connection type/provider for the target + examples: + - CUSTOM + - OPENAI + - BEDROCK + api_endpoint_type: + anyOf: + - $ref: '#/components/schemas/ApiEndpointType' + - type: 'null' + description: Accessibility type of the API endpoint + examples: + - PUBLIC + - PRIVATE + - NETWORK_BROKER + response_mode: + anyOf: + - $ref: '#/components/schemas/ResponseMode' + - type: 'null' + description: Response mode for API interactions + examples: + - REST + - STREAMING + - WEBSOCKET + auth_type: + anyOf: + - $ref: '#/components/schemas/red_team_shared__schemas__auth_config__AuthType' + - type: 'null' + description: Authentication method for target API access + examples: + - HEADERS + - BASIC_AUTH + - OAUTH2 + session_supported: + type: boolean + title: Session Supported + description: Whether target supports session for multi-turn conversations + default: false + extra_info: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Extra Info + description: Additional configuration or metadata for the target + default: {} + examples: + - custom_key: custom_value + target_metadata: + $ref: '#/components/schemas/TargetMetadata' + description: Target metadata and configuration options + target_background: + anyOf: + - $ref: '#/components/schemas/TargetBackground' + - type: 'null' + description: 'Target background: industry, use_case, competitors' + additional_context: + anyOf: + - $ref: '#/components/schemas/TargetAdditionalContext' + - type: 'null' + description: 'Additional context: base_model, system_prompt, languages, etc.' + canonical_id: + anyOf: + - + type: string + maxLength: 512 + - type: 'null' + title: Canonical Id + description: Partner-supplied stable identifier (e.g. Discovery's id). Free-form opaque string; immutable once set. + additionalProperties: false + type: object + required: + - name + title: TargetCreateRequestSchema + description: Target create request schema for validating and defining target creation parameters. + TargetListItemSchema: + properties: + uuid: type: string format: uuid - title: Prompt Uuid - tags: - - CustomAttack - /v1/custom-attack/property-names: - get: - summary: Get property names - description: Get all available property names for use in prompt sets. - operationId: get_property_names_v1_custom_attack_property_names_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/PropertyNamesListResponseSchema' - 401: - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: [] - tags: - - CustomAttack - post: - summary: Create property name - description: Create a new property name that can be used in prompt sets. - operationId: create_property_name_v1_custom_attack_property_names_post - responses: - 201: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/PropertyNamesListResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: [] - tags: - - CustomAttack - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PropertyNameCreateRequestSchema' - required: true - /v1/custom-attack/property-values/{property_name}: - get: - summary: Get property name - description: Get all available values for a specific property name. - operationId: get_property_values_v1_custom_attack_property_values__property_name__get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/PropertyValuesResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: property_name - in: path - required: true - schema: + title: Uuid + tsg_id: + type: string + title: Tsg Id + name: + type: string + title: Name + description: Target name + examples: + - GPT 4.1 Nano + description: + anyOf: + - type: string + - type: 'null' + title: Description + description: Optional target description + default: + examples: + - AI model for testing + target_type: + anyOf: + - $ref: '#/components/schemas/TargetType' + - type: 'null' + description: Type of target + connection_type: + anyOf: + - $ref: '#/components/schemas/TargetConnectionType' + - type: 'null' + description: Connection type/provider for the target + examples: + - CUSTOM + - OPENAI + - BEDROCK + api_endpoint_type: + anyOf: + - $ref: '#/components/schemas/ApiEndpointType' + - type: 'null' + description: Accessibility type of the API endpoint + examples: + - PUBLIC + - PRIVATE + - NETWORK_BROKER + response_mode: + anyOf: + - $ref: '#/components/schemas/ResponseMode' + - type: 'null' + description: Response mode for API interactions + examples: + - REST + - STREAMING + - WEBSOCKET + auth_type: + anyOf: + - $ref: '#/components/schemas/red_team_shared__schemas__auth_config__AuthType' + - type: 'null' + description: Authentication method for target API access + examples: + - HEADERS + - BASIC_AUTH + - OAUTH2 + session_supported: + type: boolean + title: Session Supported + description: Whether target supports session for multi-turn conversations + default: false + extra_info: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Extra Info + description: Additional configuration or metadata for the target + default: {} + examples: + - custom_key: custom_value + status: + $ref: '#/components/schemas/TargetStatus' + description: Target status + active: + type: boolean + title: Active + description: Whether target is active + validated: + type: boolean + title: Validated + description: Whether target is validated + version: + anyOf: + - type: integer + - type: 'null' + title: Version + description: Configuration version + secret_version: + anyOf: + - type: string + - type: 'null' + title: Secret Version + description: 'Secret Manager version for connection_params. When present, sensitive connection data is stored in Secret Manager. When None, connection_params are stored in GCS (legacy).' + created_by_user_id: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Created By User Id + description: User ID of target creator + updated_by_user_id: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Updated By User Id + description: User ID of last target updater + created_at: + type: string + format: date-time + title: Created At + description: Creation timestamp + updated_at: + type: string + format: date-time + title: Updated At + description: Last update timestamp + profiling_status: + anyOf: + - $ref: '#/components/schemas/ProfilingStatus' + - type: 'null' + description: Status of the profiling workflow + canonical_id: + anyOf: + - type: string + - type: 'null' + title: Canonical Id + description: Partner-supplied stable identifier. Null for targets without partner integration metadata (most targets). + type: object + required: + - uuid + - tsg_id + - name + - status + - active + - validated + - created_at + - updated_at + title: TargetListItemSchema + TargetListSchema: + properties: + pagination: + $ref: '#/components/schemas/PaginationSchema' + data: + items: + $ref: '#/components/schemas/TargetListItemSchema' + type: array + title: Data + description: List of targets + type: object + required: + - pagination + title: TargetListSchema + description: Schema returned by API for list target operations. + TargetMetadata: + properties: + multi_turn: + type: boolean + title: Multi Turn + description: Whether target supports multi-turn conversations (Probe 2 result) + default: false + multi_turn_error_message: + anyOf: + - type: string + - type: 'null' + title: Multi Turn Error Message + description: Concise error message if Probe 2 failed + examples: + - Session ID extraction failed + - Assistant role not configured + rate_limit: + anyOf: + - type: integer + - type: 'null' + title: Rate Limit + description: Current rate limit value + examples: + - 996 + rate_limit_enabled: + type: boolean + title: Rate Limit Enabled + description: Whether rate limiting is enabled + default: false + rate_limit_error_code: + anyOf: + - type: integer + - type: 'null' + title: Rate Limit Error Code + description: HTTP status code for rate limit errors + examples: + - 429 + rate_limit_error_json: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Rate Limit Error Json + description: JSON structure of rate limit error response + examples: + - error: + code: rate_limit_exceeded + message: 'Rate limit reached for o1-preview on requests per min (RPM): Limit 20, Used 20, Requested 1. Please try again in 3s. Visit https://platform.openai.com/account/rate-limits to learn more.' + param: 'null' + type: requests + rate_limit_error_message: + anyOf: + - type: string + - type: 'null' + title: Rate Limit Error Message + description: Raw error message string for rate limit errors + examples: + - 'Rate limit reached for o1-preview on requests per min (RPM): Limit 20, Used 20, Requested 1. Please try again in 3s.' + content_filter_enabled: + type: boolean + title: Content Filter Enabled + description: Whether content filtering is enabled + default: false + content_filter_error_code: + anyOf: + - type: integer + - type: 'null' + title: Content Filter Error Code + description: HTTP status code for content filter errors + examples: + - 400 + content_filter_error_json: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Content Filter Error Json + description: JSON structure of content filter error response + examples: + - error: + code: invalid_prompt + message: 'Invalid prompt: your prompt was flagged as potentially violating our usage policy. Please try again with a different prompt.' + type: invalid_request_error + content_filter_error_message: + anyOf: + - type: string + - type: 'null' + title: Content Filter Error Message + description: Raw error message string for content filter errors + examples: + - 'Invalid prompt: your prompt was flagged as potentially violating our usage policy. Please try again with a different prompt.' + probe_message: + type: string + title: Probe Message + default: 'Hello, this is a test message from the red team validation system.' + request_timeout: + type: number + title: Request Timeout + description: Request timeout in seconds + default: 110 + examples: + - 110 + type: object + title: TargetMetadata + description: Metadata stored in the database for targets (user-provided + computed fields). + TargetProbeRequest: + properties: + connection_params: + anyOf: + - oneOf: + - $ref: '#/components/schemas/NativeConnectionParamsBase-Input' + - $ref: '#/components/schemas/WebSocketConnectionParamsBase-Input' + - $ref: '#/components/schemas/StreamingConnectionParamsBase-Input' + - $ref: '#/components/schemas/RestConnectionParamsBase-Input' + - type: 'null' + title: Connection Params + description: API connection parameters (sensitive data masked for security) + examples: + - + api_endpoint: https://api.openai.com/v1/responses + request_headers: + Authorization: Bearer sk-xxx + Content-Type: application/json + request_json: + input: + - + content: + - + text: '{INPUT}' + type: input_text + role: user + model: gpt-4.1-nano + response_json: + content: '{RESPONSE}' + response_key: content + auth_config: + anyOf: + - $ref: '#/components/schemas/HeadersAuthConfig' + - $ref: '#/components/schemas/BasicAuthAuthConfig' + - $ref: '#/components/schemas/OAuth2AuthConfig' + - type: 'null' + title: Auth Config + description: Authentication configuration (resolved based on auth_type) + network_broker_channel_uuid: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Network Broker Channel Uuid + description: Network broker channel UUID for routing requests. Required when api_endpoint_type is NETWORK_BROKER. + examples: + - 550e8400-e29b-41d4-a716-446655440000 + name: + type: string + title: Name + description: Target name + examples: + - GPT 4.1 Nano + description: + anyOf: + - type: string + - type: 'null' + title: Description + description: Optional target description + default: + examples: + - AI model for testing + target_type: + anyOf: + - $ref: '#/components/schemas/TargetType' + - type: 'null' + description: Type of target + connection_type: + anyOf: + - $ref: '#/components/schemas/TargetConnectionType' + - type: 'null' + description: Connection type/provider for the target + examples: + - CUSTOM + - OPENAI + - BEDROCK + api_endpoint_type: + anyOf: + - $ref: '#/components/schemas/ApiEndpointType' + - type: 'null' + description: Accessibility type of the API endpoint + examples: + - PUBLIC + - PRIVATE + - NETWORK_BROKER + response_mode: + anyOf: + - $ref: '#/components/schemas/ResponseMode' + - type: 'null' + description: Response mode for API interactions + examples: + - REST + - STREAMING + - WEBSOCKET + auth_type: + anyOf: + - $ref: '#/components/schemas/red_team_shared__schemas__auth_config__AuthType' + - type: 'null' + description: Authentication method for target API access + examples: + - HEADERS + - BASIC_AUTH + - OAUTH2 + session_supported: + type: boolean + title: Session Supported + description: Whether target supports session for multi-turn conversations + default: false + extra_info: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Extra Info + description: Additional configuration or metadata for the target + default: {} + examples: + - custom_key: custom_value + target_metadata: + $ref: '#/components/schemas/TargetMetadata' + description: Target metadata and configuration options + target_background: + anyOf: + - $ref: '#/components/schemas/TargetBackground' + - type: 'null' + description: 'Target background: industry, use_case, competitors' + additional_context: + anyOf: + - $ref: '#/components/schemas/TargetAdditionalContext' + - type: 'null' + description: 'Additional context: base_model, system_prompt, languages, etc.' + canonical_id: + anyOf: + - + type: string + maxLength: 512 + - type: 'null' + title: Canonical Id + description: Partner-supplied stable identifier (e.g. Discovery's id). Free-form opaque string; immutable once set. + uuid: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Uuid + description: 'Target UUID. If provided, will be returned in response.' + probe_fields: + anyOf: + - + items: + type: string + type: array + - type: 'null' + title: Probe Fields + description: 'Specific probes to run. If None, runs all probes. Valid: industry, use_case, competitors, base_model, core_architecture, languages_supported, tools_accessible, system_prompt, banned_keywords' + additionalProperties: false + type: object + required: + - name + title: TargetProbeRequest + description: | + Request to run profiling probes on a target. + + Inherits all target creation fields (connection params, metadata, etc.) + If probe_fields is None, runs all 9 probes. Otherwise runs only specified probes. + TargetProfileResponse: + properties: + target_id: + type: string + format: uuid + title: Target Id + target_version: + type: integer + title: Target Version + status: + type: string + title: Status + target_background: + anyOf: + - $ref: '#/components/schemas/TargetBackground' + - type: 'null' + additional_context: + anyOf: + - $ref: '#/components/schemas/TargetAdditionalContext' + - type: 'null' + other_details: + anyOf: + - $ref: '#/components/schemas/OtherDetails' + - type: 'null' + other_details_prettified: + anyOf: + - $ref: '#/components/schemas/OtherDetailsPrettified' + - type: 'null' + ai_generated_fields: + anyOf: + - + items: + type: string + type: array + - type: 'null' + title: Ai Generated Fields + description: 'Field names populated by AI profiler (e.g., competitors, base_model, system_prompt)' + ai_generated_items: + anyOf: + - $ref: '#/components/schemas/AiGeneratedItems' + - type: 'null' + profiling_completed_at: + anyOf: + - + type: string + format: date-time + - type: 'null' + title: Profiling Completed At + description: When profiling finished + profiling_status: + anyOf: + - type: string + - type: 'null' + title: Profiling Status + description: Status of the profiling workflow + profiling_progress: + anyOf: + - type: integer + - type: 'null' + title: Profiling Progress + description: Profiling progress percentage (0–100) + type: object + required: + - target_id + - target_version + - status + title: TargetProfileResponse + description: Combined response for profile view. + TargetRedactSchema: + properties: + connection_params: + anyOf: + - oneOf: + - $ref: '#/components/schemas/NativeConnectionParamsRedactBase' + - $ref: '#/components/schemas/WebSocketConnectionParamsRedactBase' + - $ref: '#/components/schemas/StreamingConnectionParamsRedactBase' + - $ref: '#/components/schemas/RestConnectionParamsRedactBase' + - type: 'null' + title: Connection Params + description: API connection parameters (sensitive data masked for security) + auth_config: + anyOf: + - $ref: '#/components/schemas/HeadersAuthConfigRedact' + - $ref: '#/components/schemas/BasicAuthAuthConfigRedact' + - $ref: '#/components/schemas/OAuth2AuthConfigRedact' + - type: 'null' + title: Auth Config + description: Authentication configuration (sensitive data masked for security) + network_broker_channel_uuid: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Network Broker Channel Uuid + description: Network broker channel UUID for routing requests. Required when api_endpoint_type is NETWORK_BROKER. + examples: + - 550e8400-e29b-41d4-a716-446655440000 + uuid: + type: string + format: uuid + title: Uuid + tsg_id: + type: string + title: Tsg Id + name: + type: string + title: Name + description: Target name + examples: + - GPT 4.1 Nano + description: + anyOf: + - type: string + - type: 'null' + title: Description + description: Optional target description + default: + examples: + - AI model for testing + target_type: + anyOf: + - $ref: '#/components/schemas/TargetType' + - type: 'null' + description: Type of target + connection_type: + anyOf: + - $ref: '#/components/schemas/TargetConnectionType' + - type: 'null' + description: Connection type/provider for the target + examples: + - CUSTOM + - OPENAI + - BEDROCK + api_endpoint_type: + anyOf: + - $ref: '#/components/schemas/ApiEndpointType' + - type: 'null' + description: Accessibility type of the API endpoint + examples: + - PUBLIC + - PRIVATE + - NETWORK_BROKER + response_mode: + anyOf: + - $ref: '#/components/schemas/ResponseMode' + - type: 'null' + description: Response mode for API interactions + examples: + - REST + - STREAMING + - WEBSOCKET + auth_type: + anyOf: + - $ref: '#/components/schemas/red_team_shared__schemas__auth_config__AuthType' + - type: 'null' + description: Authentication method for target API access + examples: + - HEADERS + - BASIC_AUTH + - OAUTH2 + session_supported: + type: boolean + title: Session Supported + description: Whether target supports session for multi-turn conversations + default: false + extra_info: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Extra Info + description: Additional configuration or metadata for the target + default: {} + examples: + - custom_key: custom_value + status: + $ref: '#/components/schemas/TargetStatus' + description: Target status + active: + type: boolean + title: Active + description: Whether target is active + validated: + type: boolean + title: Validated + description: Whether target is validated + version: + anyOf: + - type: integer + - type: 'null' + title: Version + description: Configuration version reference for encrypted config + secret_version: + anyOf: + - type: string + - type: 'null' + title: Secret Version + description: 'Secret Manager version for connection_params. When present, sensitive connection data is stored in Secret Manager. When None, connection_params are stored in GCS (legacy).' + created_by_user_id: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Created By User Id + description: User ID of target creator + updated_by_user_id: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Updated By User Id + description: User ID of last target updater + created_at: + type: string + format: date-time + title: Created At + description: Creation timestamp + updated_at: + type: string + format: date-time + title: Updated At + description: Last update timestamp + profiling_status: + anyOf: + - $ref: '#/components/schemas/ProfilingStatus' + - type: 'null' + description: Status of the profiling workflow + canonical_id: + anyOf: + - type: string + - type: 'null' + title: Canonical Id + description: Partner-supplied stable identifier. Null for targets without partner integration metadata (most targets). + target_metadata: + $ref: '#/components/schemas/TargetMetadata' + description: Target metadata and configuration options + target_background: + anyOf: + - $ref: '#/components/schemas/TargetBackground' + - type: 'null' + description: 'Target background info: industry, use_case, competitors' + profiling_progress: + anyOf: + - type: integer + - type: 'null' + title: Profiling Progress + description: Profiling progress percentage (0–100) + additional_context: + anyOf: + - $ref: '#/components/schemas/TargetAdditionalContext' + - type: 'null' + description: Additional context with source tracking (user + profiler) + type: object + required: + - uuid + - tsg_id + - name + - status + - active + - validated + - created_at + - updated_at + title: TargetRedactSchema + description: Target redact Schema + TargetResponseSchema: + properties: + uuid: + type: string + format: uuid + title: Uuid + tsg_id: + type: string + title: Tsg Id + name: + type: string + title: Name + description: Target name + examples: + - GPT 4.1 Nano + description: + anyOf: + - type: string + - type: 'null' + title: Description + description: Optional target description + default: + examples: + - AI model for testing + target_type: + anyOf: + - $ref: '#/components/schemas/TargetType' + - type: 'null' + description: Type of target + connection_type: + anyOf: + - $ref: '#/components/schemas/TargetConnectionType' + - type: 'null' + description: Connection type/provider for the target + examples: + - CUSTOM + - OPENAI + - BEDROCK + api_endpoint_type: + anyOf: + - $ref: '#/components/schemas/ApiEndpointType' + - type: 'null' + description: Accessibility type of the API endpoint + examples: + - PUBLIC + - PRIVATE + - NETWORK_BROKER + response_mode: + anyOf: + - $ref: '#/components/schemas/ResponseMode' + - type: 'null' + description: Response mode for API interactions + examples: + - REST + - STREAMING + - WEBSOCKET + auth_type: + anyOf: + - $ref: '#/components/schemas/red_team_shared__schemas__auth_config__AuthType' + - type: 'null' + description: Authentication method for target API access + examples: + - HEADERS + - BASIC_AUTH + - OAUTH2 + session_supported: + type: boolean + title: Session Supported + description: Whether target supports session for multi-turn conversations + default: false + extra_info: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Extra Info + description: Additional configuration or metadata for the target + default: {} + examples: + - custom_key: custom_value + status: + $ref: '#/components/schemas/TargetStatus' + description: Target status + active: + type: boolean + title: Active + description: Whether target is active + validated: + type: boolean + title: Validated + description: Whether target is validated + version: + anyOf: + - type: integer + - type: 'null' + title: Version + description: Configuration version + secret_version: + anyOf: + - type: string + - type: 'null' + title: Secret Version + description: 'Secret Manager version for connection_params. When present, sensitive connection data is stored in Secret Manager. When None, connection_params are stored in GCS (legacy).' + created_by_user_id: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Created By User Id + description: User ID of target creator + updated_by_user_id: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Updated By User Id + description: User ID of last target updater + created_at: + type: string + format: date-time + title: Created At + description: Creation timestamp + updated_at: + type: string + format: date-time + title: Updated At + description: Last update timestamp + profiling_status: + anyOf: + - $ref: '#/components/schemas/ProfilingStatus' + - type: 'null' + description: Status of the profiling workflow + canonical_id: + anyOf: + - type: string + - type: 'null' + title: Canonical Id + description: Partner-supplied stable identifier. Null for targets without partner integration metadata (most targets). + target_metadata: + $ref: '#/components/schemas/TargetMetadata' + description: Target metadata and configuration options + target_background: + anyOf: + - $ref: '#/components/schemas/TargetBackground' + - type: 'null' + description: 'Target background info: industry, use_case, competitors' + profiling_progress: + anyOf: + - type: integer + - type: 'null' + title: Profiling Progress + description: Profiling progress percentage (0–100) + additional_context: + anyOf: + - $ref: '#/components/schemas/TargetAdditionalContext' + - type: 'null' + description: Additional context with source tracking (user + profiler) + type: object + required: + - uuid + - tsg_id + - name + - status + - active + - validated + - created_at + - updated_at + title: TargetResponseSchema + TargetSchema: + properties: + connection_params: + anyOf: + - oneOf: + - $ref: '#/components/schemas/NativeConnectionParamsBase-Output' + - $ref: '#/components/schemas/WebSocketConnectionParamsBase-Output' + - $ref: '#/components/schemas/StreamingConnectionParamsBase-Output' + - $ref: '#/components/schemas/RestConnectionParamsBase-Output' + - type: 'null' + title: Connection Params + description: API connection parameters (sensitive data masked for security) + examples: + - + api_endpoint: https://api.openai.com/v1/responses + request_headers: + Authorization: Bearer sk-xxx + Content-Type: application/json + request_json: + input: + - + content: + - + text: '{INPUT}' + type: input_text + role: user + model: gpt-4.1-nano + response_json: + content: '{RESPONSE}' + response_key: content + auth_config: + anyOf: + - $ref: '#/components/schemas/HeadersAuthConfig' + - $ref: '#/components/schemas/BasicAuthAuthConfig' + - $ref: '#/components/schemas/OAuth2AuthConfig' + - type: 'null' + title: Auth Config + description: Authentication configuration (resolved based on auth_type) + network_broker_channel_uuid: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Network Broker Channel Uuid + description: Network broker channel UUID for routing requests. Required when api_endpoint_type is NETWORK_BROKER. + examples: + - 550e8400-e29b-41d4-a716-446655440000 + uuid: type: string - title: Property Name - tags: - - CustomAttack - /v1/custom-attack/property-values: - post: - summary: Create property value - description: Create a new value for an existing property name. - operationId: create_property_value_v1_custom_attack_property_values_post - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/BaseResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: [] - tags: - - CustomAttack - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/PropertyValueCreateRequestSchema' - get: - summary: Get values for multiple property names - description: Get values for multiple property names in a single request. - operationId: get_property_values_multiple_v1_custom_attack_property_values_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/PropertyValuesMultipleResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: property_names - in: query - required: true - schema: + format: uuid + title: Uuid + tsg_id: + type: string + title: Tsg Id + name: + type: string + title: Name + description: Target name + examples: + - GPT 4.1 Nano + description: + anyOf: + - type: string + - type: 'null' + title: Description + description: Optional target description + default: + examples: + - AI model for testing + target_type: + anyOf: + - $ref: '#/components/schemas/TargetType' + - type: 'null' + description: Type of target + connection_type: + anyOf: + - $ref: '#/components/schemas/TargetConnectionType' + - type: 'null' + description: Connection type/provider for the target + examples: + - CUSTOM + - OPENAI + - BEDROCK + api_endpoint_type: + anyOf: + - $ref: '#/components/schemas/ApiEndpointType' + - type: 'null' + description: Accessibility type of the API endpoint + examples: + - PUBLIC + - PRIVATE + - NETWORK_BROKER + response_mode: + anyOf: + - $ref: '#/components/schemas/ResponseMode' + - type: 'null' + description: Response mode for API interactions + examples: + - REST + - STREAMING + - WEBSOCKET + auth_type: + anyOf: + - $ref: '#/components/schemas/red_team_shared__schemas__auth_config__AuthType' + - type: 'null' + description: Authentication method for target API access + examples: + - HEADERS + - BASIC_AUTH + - OAUTH2 + session_supported: + type: boolean + title: Session Supported + description: Whether target supports session for multi-turn conversations + default: false + extra_info: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Extra Info + description: Additional configuration or metadata for the target + default: {} + examples: + - custom_key: custom_value + status: + $ref: '#/components/schemas/TargetStatus' + description: Target status + active: + type: boolean + title: Active + description: Whether target is active + validated: + type: boolean + title: Validated + description: Whether target is validated + version: + anyOf: + - type: integer + - type: 'null' + title: Version + description: Configuration version reference for encrypted config + secret_version: + anyOf: + - type: string + - type: 'null' + title: Secret Version + description: 'Secret Manager version for connection_params. When present, sensitive connection data is stored in Secret Manager. When None, connection_params are stored in GCS (legacy).' + created_by_user_id: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Created By User Id + description: User ID of target creator + updated_by_user_id: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Updated By User Id + description: User ID of last target updater + created_at: + type: string + format: date-time + title: Created At + description: Creation timestamp + updated_at: + type: string + format: date-time + title: Updated At + description: Last update timestamp + profiling_status: + anyOf: + - $ref: '#/components/schemas/ProfilingStatus' + - type: 'null' + description: Status of the profiling workflow + canonical_id: + anyOf: + - type: string + - type: 'null' + title: Canonical Id + description: Partner-supplied stable identifier. Null for targets without partner integration metadata (most targets). + target_metadata: + $ref: '#/components/schemas/TargetMetadata' + description: Target metadata and configuration options + target_background: + anyOf: + - $ref: '#/components/schemas/TargetBackground' + - type: 'null' + description: 'Target background info: industry, use_case, competitors' + profiling_progress: + anyOf: + - type: integer + - type: 'null' + title: Profiling Progress + description: Profiling progress percentage (0–100) + additional_context: + anyOf: + - $ref: '#/components/schemas/TargetAdditionalContext' + - type: 'null' + description: Additional context with source tracking (user + profiler) + type: object + required: + - uuid + - tsg_id + - name + - status + - active + - validated + - created_at + - updated_at + title: TargetSchema + description: | + Target Get Schema with profiling fields. + + Inherits from TargetDetailSchema which includes: + - target_background: industry, use_case, competitors + - profiling_status: INIT, QUEUED, IN_PROGRESS, COMPLETED, FAILED + - additional_context: merged user + profiler values with source tracking + TargetStatus: + type: string + enum: + - DRAFT + - VALIDATING + - VALIDATED + - ACTIVE + - INACTIVE + - FAILED + - PENDING_AUTH + title: TargetStatus + description: Status enumeration for scan targets. + TargetStatusFilter: + type: string + enum: + - DRAFT + - ACTIVE + - FAILED + - QUEUED + - IN_PROGRESS + - COMPLETED + - PARTIALLY_COMPLETE + title: TargetStatusFilter + description: | + Status values accepted by the list-targets ``status`` filter. + + Unions the target status and profiling status values so a single ``status`` + filter can match on either. A supplied value matches a target whose target + status or profiling status equals it. + + Note (internal): keep members in sync with :class:`TargetStatus` and + :class:`ProfilingStatus`. ``FAILED`` is shared by both and defined once. + TargetType: + type: string + enum: + - APPLICATION + - AGENT + - MODEL + title: TargetType + description: Target Types Available + TargetUpdateRequestSchema: + properties: + connection_params: + anyOf: + - oneOf: + - $ref: '#/components/schemas/NativeConnectionParamsBase-Input' + - $ref: '#/components/schemas/WebSocketConnectionParamsBase-Input' + - $ref: '#/components/schemas/StreamingConnectionParamsBase-Input' + - $ref: '#/components/schemas/RestConnectionParamsBase-Input' + - type: 'null' + title: Connection Params + description: API connection parameters (sensitive data masked for security) + examples: + - + api_endpoint: https://api.openai.com/v1/responses + request_headers: + Authorization: Bearer sk-xxx + Content-Type: application/json + request_json: + input: + - + content: + - + text: '{INPUT}' + type: input_text + role: user + model: gpt-4.1-nano + response_json: + content: '{RESPONSE}' + response_key: content + auth_config: + anyOf: + - $ref: '#/components/schemas/HeadersAuthConfig' + - $ref: '#/components/schemas/BasicAuthAuthConfig' + - $ref: '#/components/schemas/OAuth2AuthConfig' + - type: 'null' + title: Auth Config + description: Authentication configuration (resolved based on auth_type) + network_broker_channel_uuid: + anyOf: + - + type: string + format: uuid + - type: 'null' + title: Network Broker Channel Uuid + description: Network broker channel UUID for routing requests. Required when api_endpoint_type is NETWORK_BROKER. + examples: + - 550e8400-e29b-41d4-a716-446655440000 + name: type: string - description: Comma-separated list of property names - title: Property Names - description: Comma-separated list of property names - tags: - - CustomAttack - /v1/custom-attack/upload-custom-prompts-csv: - post: - summary: Upload custom prompts - description: Upload a CSV file containing custom prompts with properties for - a specific prompt set. - operationId: upload_prompts_csv_v1_custom_attack_upload_custom_prompts_csv_post - responses: - 201: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/BaseResponseSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: prompt_set_uuid - in: query - required: true - schema: + title: Name + description: Target name + examples: + - GPT 4.1 Nano + description: + anyOf: + - type: string + - type: 'null' + title: Description + description: Optional target description + default: + examples: + - AI model for testing + target_type: + anyOf: + - $ref: '#/components/schemas/TargetType' + - type: 'null' + description: Type of target + connection_type: + anyOf: + - $ref: '#/components/schemas/TargetConnectionType' + - type: 'null' + description: Connection type/provider for the target + examples: + - CUSTOM + - OPENAI + - BEDROCK + api_endpoint_type: + anyOf: + - $ref: '#/components/schemas/ApiEndpointType' + - type: 'null' + description: Accessibility type of the API endpoint + examples: + - PUBLIC + - PRIVATE + - NETWORK_BROKER + response_mode: + anyOf: + - $ref: '#/components/schemas/ResponseMode' + - type: 'null' + description: Response mode for API interactions + examples: + - REST + - STREAMING + - WEBSOCKET + auth_type: + anyOf: + - $ref: '#/components/schemas/red_team_shared__schemas__auth_config__AuthType' + - type: 'null' + description: Authentication method for target API access + examples: + - HEADERS + - BASIC_AUTH + - OAUTH2 + session_supported: + type: boolean + title: Session Supported + description: Whether target supports session for multi-turn conversations + default: false + extra_info: + anyOf: + - + additionalProperties: true + type: object + - type: 'null' + title: Extra Info + description: Additional configuration or metadata for the target + default: {} + examples: + - custom_key: custom_value + target_metadata: + $ref: '#/components/schemas/TargetMetadata' + description: Target metadata and configuration options + target_background: + anyOf: + - $ref: '#/components/schemas/TargetBackground' + - type: 'null' + description: 'Target background: industry, use_case, competitors' + additional_context: + anyOf: + - $ref: '#/components/schemas/TargetAdditionalContext' + - type: 'null' + description: 'Additional context: base_model, system_prompt, languages, etc.' + canonical_id: + anyOf: + - + type: string + maxLength: 512 + - type: 'null' + title: Canonical Id + description: Partner-supplied stable identifier (e.g. Discovery's id). Free-form opaque string; immutable once set. + additionalProperties: false + type: object + required: + - name + title: TargetUpdateRequestSchema + description: Schema for both create and update operations. + TenantLanguagesResponseSchema: + properties: + multilingual_enabled: + type: boolean + title: Multilingual Enabled + supported_job_types: + items: + type: string + type: array + title: Supported Job Types + languages: + items: + $ref: '#/components/schemas/LanguageOptionSchema' + type: array + title: Languages + type: object + required: + - multilingual_enabled + - supported_job_types + - languages + title: TenantLanguagesResponseSchema + description: Response for GET /v1/languages — tenant-facing language dropdown. + ValidationError: + properties: + loc: + items: + anyOf: + - type: string + - type: integer + type: array + title: Location + msg: type: string - format: uuid - description: UUID of the prompt set - title: Prompt Set Uuid - description: UUID of the prompt set - tags: - - CustomAttack - requestBody: - required: true - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/Body_upload_prompts_csv_v1_custom_attack_upload_custom_prompts_csv_post' - /v1/custom-attack/download-template/{prompt_set_uuid}: - get: - summary: Download template for a prompt set - description: Download a CSV template with columns for the prompt set's properties. - operationId: download_template_v1_custom_attack_download_template__prompt_set_uuid__get - responses: - 200: - description: Successful Response - content: - application/json: - schema: {} - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: prompt_set_uuid - in: path - required: true - schema: + title: Message + type: type: string - format: uuid - title: Prompt Set Uuid - tags: - - CustomAttack - /v1/custom-attack/active-custom-prompt-sets: - get: - summary: List active custom prompt sets - description: List all active custom prompt sets available for use by data plane. - Returns only sets with snapshots. - operationId: list_active_prompt_sets_v1_custom_attack_active_custom_prompt_sets_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/CustomPromptSetListActiveSchema' - 401: - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: [] - tags: - - CustomAttack - /v1/custom-attack/custom-prompt-set/{prompt_set_uuid}/reference: - get: - summary: Resolve prompt set reference - description: Get current reference information for a prompt set including latest - version. - operationId: resolve_prompt_set_reference_v1_custom_attack_custom_prompt_set__prompt_set_uuid__reference_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/CustomPromptSetReferenceSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: prompt_set_uuid - in: path - required: true - schema: + title: Error Type + type: object + required: + - loc + - msg + - type + title: ValidationError + WebSocketConnectionParamsBase-Input: + properties: + api_endpoint: + anyOf: + - type: string + - type: 'null' + title: Api Endpoint + description: API endpoint URL + examples: + - https://api.openai.com/v1/responses + request_headers: + additionalProperties: true + type: object + title: Request Headers + description: Request headers + default: {} + examples: + - + Authorization: Bearer sk-xxx + Content-Type: application/json + request_json: + additionalProperties: true + type: object + title: Request Json + description: Request JSON + default: {} + examples: + - + input: + - + content: + - + text: '{INPUT}' + type: input_text + role: user + model: gpt-4.1-nano + response_json: + additionalProperties: true + type: object + title: Response Json + description: Response JSON + default: {} + examples: + - content: '{RESPONSE}' + response_key: type: string - format: uuid - title: Prompt Set Uuid - tags: - - CustomAttack - /v1/custom-attack/custom-prompt-set/{prompt_set_uuid}/version-info: - get: - summary: Get prompt set version information - description: Get detailed version information for a specific prompt set version. - operationId: get_prompt_set_version_info_v1_custom_attack_custom_prompt_set__prompt_set_uuid__version_info_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/CustomPromptSetVersionInfoSchema' - 422: - description: Validation Error - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: - - name: prompt_set_uuid - in: path - required: true - schema: + title: Response Key + description: Response key + default: + examples: + - content + target_connection_config: + anyOf: + - $ref: '#/components/schemas/OpenAIConnectionParams' + - $ref: '#/components/schemas/HuggingfaceConnectionParams' + - $ref: '#/components/schemas/DatabricksConnectionParams' + - $ref: '#/components/schemas/BedrockAccessConnectionParams' + - $ref: '#/components/schemas/MSCopilotStudioConnectionParams' + - type: 'null' + title: Target Connection Config + description: Target Connection config of type openai/huggingface .. + curl: + anyOf: + - type: string + - type: 'null' + title: Curl + description: Generated cURL command ready to use (redacted for security) + examples: + - 'curl "https://api.openai.com/v1/chat/completions" -H "Content-Type: application/json" -H "Authorization: Bearer ***" -d ''{"model":"gpt-4","messages":[{"role":"user","content":"{INPUT}"}]}''' + multi_turn_config: + anyOf: + - + oneOf: + - $ref: '#/components/schemas/MultiTurnStatefulConfig' + - $ref: '#/components/schemas/MultiTurnStatelessConfig' + discriminator: + propertyName: type + mapping: + stateful: '#/components/schemas/MultiTurnStatefulConfig' + stateless: '#/components/schemas/MultiTurnStatelessConfig' + - type: 'null' + title: Multi Turn Config + description: Multi turn config for stateful or stateless target + examples: + - 'assistant_role: assistant' + ws_response_timeout: + type: number + title: Ws Response Timeout + description: Timeout in seconds for waiting for a WebSocket response message + default: 110.0 + examples: + - 60.0 + - 110.0 + type: object + title: WebSocketConnectionParamsBase + description: Connection parameters for WebSocket targets. + WebSocketConnectionParamsBase-Output: + properties: + api_endpoint: + anyOf: + - type: string + - type: 'null' + title: Api Endpoint + description: API endpoint URL + examples: + - https://api.openai.com/v1/responses + request_headers: + additionalProperties: true + type: object + title: Request Headers + description: Request headers + default: {} + examples: + - + Authorization: Bearer sk-xxx + Content-Type: application/json + request_json: + additionalProperties: true + type: object + title: Request Json + description: Request JSON + default: {} + examples: + - + input: + - + content: + - + text: '{INPUT}' + type: input_text + role: user + model: gpt-4.1-nano + response_json: + additionalProperties: true + type: object + title: Response Json + description: Response JSON + default: {} + examples: + - content: '{RESPONSE}' + response_key: type: string - format: uuid - title: Prompt Set Uuid - - name: version - in: query - required: false - schema: + title: Response Key + description: Response key + default: + examples: + - content + target_connection_config: + anyOf: + - $ref: '#/components/schemas/OpenAIConnectionParams' + - $ref: '#/components/schemas/HuggingfaceConnectionParams' + - $ref: '#/components/schemas/DatabricksConnectionParams' + - $ref: '#/components/schemas/BedrockAccessConnectionParams' + - $ref: '#/components/schemas/MSCopilotStudioConnectionParams' + - type: 'null' + title: Target Connection Config + description: Target Connection config of type openai/huggingface .. + curl: anyOf: - type: string - type: 'null' - description: Specific version ID - title: Version - description: Specific version ID - tags: - - CustomAttack - /v1/dashboard/overview: - get: - summary: Get dashboard - description: Returns target counts by type for dashboard display. - operationId: get_overview_v1_dashboard_overview_get - responses: - 200: - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/DashboardOverviewResponseSchema' - 401: - description: Unauthorized - content: - application/json: - schema: - $ref: '#/components/schemas/HTTPValidationError' - parameters: [] - tags: - - Dashboard + title: Curl + description: Generated cURL command ready to use (redacted for security) + examples: + - 'curl "https://api.openai.com/v1/chat/completions" -H "Content-Type: application/json" -H "Authorization: Bearer ***" -d ''{"model":"gpt-4","messages":[{"role":"user","content":"{INPUT}"}]}''' + multi_turn_config: + anyOf: + - + oneOf: + - $ref: '#/components/schemas/MultiTurnStatefulConfig' + - $ref: '#/components/schemas/MultiTurnStatelessConfig' + discriminator: + propertyName: type + mapping: + stateful: '#/components/schemas/MultiTurnStatefulConfig' + stateless: '#/components/schemas/MultiTurnStatelessConfig' + - type: 'null' + title: Multi Turn Config + description: Multi turn config for stateful or stateless target + examples: + - 'assistant_role: assistant' + ws_response_timeout: + type: number + title: Ws Response Timeout + description: Timeout in seconds for waiting for a WebSocket response message + default: 110.0 + examples: + - 60.0 + - 110.0 + type: object + title: WebSocketConnectionParamsBase + description: Connection parameters for WebSocket targets. + WebSocketConnectionParamsRedactBase: + properties: + api_endpoint: + anyOf: + - type: string + - type: 'null' + title: Api Endpoint + description: API endpoint URL + examples: + - https://api.openai.com/v1/responses + request_headers: + additionalProperties: true + type: object + title: Request Headers + description: Request headers + default: {} + examples: + - + Authorization: Bearer sk-xxx + Content-Type: application/json + request_json: + additionalProperties: true + type: object + title: Request Json + description: Request JSON + default: {} + examples: + - + input: + - + content: + - + text: '{INPUT}' + type: input_text + role: user + model: gpt-4.1-nano + response_json: + additionalProperties: true + type: object + title: Response Json + description: Response JSON + default: {} + examples: + - content: '{RESPONSE}' + response_key: + type: string + title: Response Key + description: Response key + default: + examples: + - content + target_connection_config: + anyOf: + - $ref: '#/components/schemas/OpenAIConnectionRedactParams' + - $ref: '#/components/schemas/HuggingfaceConnectionRedactParams' + - $ref: '#/components/schemas/DatabricksConnectionRedactParams' + - $ref: '#/components/schemas/BedrockAccessConnectionRedactParams' + - $ref: '#/components/schemas/MSCopilotStudioConnectionRedactParams' + - type: 'null' + title: Target Connection Config + description: Target Connection config of type openai/huggingface .. + curl: + anyOf: + - type: string + - type: 'null' + title: Curl + description: Generated cURL command ready to use (redacted for security) + examples: + - 'curl "https://api.openai.com/v1/chat/completions" -H "Content-Type: application/json" -H "Authorization: Bearer ***" -d ''{"model":"gpt-4","messages":[{"role":"user","content":"{INPUT}"}]}''' + multi_turn_config: + anyOf: + - + oneOf: + - $ref: '#/components/schemas/MultiTurnStatefulConfig' + - $ref: '#/components/schemas/MultiTurnStatelessConfig' + discriminator: + propertyName: type + mapping: + stateful: '#/components/schemas/MultiTurnStatefulConfig' + stateless: '#/components/schemas/MultiTurnStatelessConfig' + - type: 'null' + title: Multi Turn Config + description: Multi turn config for stateful or stateless target + examples: + - 'assistant_role: assistant' + ws_response_timeout: + type: number + title: Ws Response Timeout + description: Timeout in seconds for waiting for a WebSocket response message + default: 110.0 + examples: + - 60.0 + - 110.0 + type: object + title: WebSocketConnectionParamsRedactBase + description: | + Redacted connection parameters for WebSocket targets. + + MRO: WebSocketConnectionParamsRedactBase → RestConnectionParamsRedactBase + → WebSocketConnectionParamsBase → RestConnectionParamsBase. + Both RestConnectionParamsRedactBase and WebSocketConnectionParamsBase inherit + from RestConnectionParamsBase (diamond). Pydantic v2 deduplicates field validators + by name, so WebSocketConnectionParamsBase.validate_url (ws/wss) overrides + RestConnectionParamsBase.validate_url (http/https) — ws:// URLs are accepted. + red_team_shared__schemas__auth_config__AuthType: + type: string + enum: + - HEADERS + - BASIC_AUTH + - OAUTH2 + title: AuthType + description: Authentication method for target API access. + red_team_shared__schemas__databricks__AuthType: + type: string + enum: + - OAUTH + - ACCESS_TOKEN + title: AuthType \ No newline at end of file diff --git a/src/constants.ts b/src/constants.ts index 8db0321..c42451b 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -149,6 +149,8 @@ export const RED_TEAM_DASHBOARD_PATH = '/v1/dashboard'; export const RED_TEAM_QUOTA_PATH = '/v1/metering/quota'; export const RED_TEAM_ERROR_LOG_PATH = '/v1/error-log/job'; export const RED_TEAM_SENTIMENT_PATH = '/v1/sentiment'; +export const RED_TEAM_LANGUAGES_PATH = '/v1/languages'; +export const RED_TEAM_ERROR_LOG_TARGET_PROFILE_PATH = '/v1/error-log/target-profile'; // API paths — red team management plane export const RED_TEAM_TARGET_PATH = '/v1/target'; diff --git a/src/models/red-team.ts b/src/models/red-team.ts index 88d84c2..b1336ee 100644 --- a/src/models/red-team.ts +++ b/src/models/red-team.ts @@ -1030,6 +1030,24 @@ export const ErrorLogListResponseSchema = z .passthrough(); export type ErrorLogListResponse = z.infer; +// --------------------------------------------------------------------------- +// Supported languages (data plane & management plane) +// --------------------------------------------------------------------------- + +/** A single language option (code + display name). */ +export const LanguageOptionSchema = z.object({ code: z.string(), name: z.string() }).passthrough(); +export type LanguageOption = z.infer; + +/** Tenant's allowed languages for Red Team scans. */ +export const TenantLanguagesResponseSchema = z + .object({ + multilingual_enabled: z.boolean(), + supported_job_types: z.array(z.string()), + languages: z.array(LanguageOptionSchema), + }) + .passthrough(); +export type TenantLanguagesResponse = z.infer; + // --------------------------------------------------------------------------- // Management — Target schemas // --------------------------------------------------------------------------- diff --git a/src/red-team/client.ts b/src/red-team/client.ts index 74450af..2ef2b73 100644 --- a/src/red-team/client.ts +++ b/src/red-team/client.ts @@ -8,6 +8,8 @@ import { RED_TEAM_DASHBOARD_PATH, RED_TEAM_QUOTA_PATH, RED_TEAM_ERROR_LOG_PATH, + RED_TEAM_ERROR_LOG_TARGET_PROFILE_PATH, + RED_TEAM_LANGUAGES_PATH, RED_TEAM_SENTIMENT_PATH, RED_TEAM_MGMT_DASHBOARD_PATH, } from '../constants.js'; @@ -32,6 +34,7 @@ import { ErrorLogListResponseSchema, SentimentResponseSchema, DashboardOverviewResponseSchema, + TenantLanguagesResponseSchema, type ScanStatisticsResponse, type ScoreTrendResponse, type QuotaSummary, @@ -39,6 +42,7 @@ import { type SentimentRequest, type SentimentResponse, type DashboardOverviewResponse, + type TenantLanguagesResponse, } from '../models/red-team.js'; /** Options for constructing a {@link RedTeamClient}. */ @@ -263,6 +267,88 @@ export class RedTeamClient { }); } + /** + * List profiling error logs for a target (data plane). + * @param targetId - The target UUID. + * @param opts - Optional pagination/search options (the endpoint honors `limit`). + * @returns The paginated list of target-profile error logs. + * @example + * ```ts + * import { RedTeamClient } from '@cdot65/prisma-airs-sdk'; + * const rt = new RedTeamClient(); + * + * const logs = await rt.getTargetProfileErrorLogs('550e8400-e29b-41d4-a716-446655440000', { limit: 10 }); + * // logs => + * // { pagination: { total_items: 1 }, data: [{ target_id: '550e8400-...', error_type: 'PROBE', error_message: '...', created_at: '2025-01-01T00:00:00Z' }] } + * ``` + */ + async getTargetProfileErrorLogs( + targetId: string, + opts?: RedTeamListOptions, + ): Promise { + assertUuid(targetId, 'target id'); + return request({ + method: 'GET', + baseUrl: this.dataEndpoint, + path: `${RED_TEAM_ERROR_LOG_TARGET_PROFILE_PATH}/${targetId}`, + params: serializeListing(opts), + responseSchema: ErrorLogListResponseSchema, + auth: this.auth, + numRetries: this.numRetries, + }); + } + + /** + * Get the tenant's allowed languages for Red Team scans (data plane). + * @returns The supported-languages response. + * @example + * ```ts + * import { RedTeamClient } from '@cdot65/prisma-airs-sdk'; + * const rt = new RedTeamClient(); + * + * const langs = await rt.getLanguages(); + * // langs => + * // { multilingual_enabled: true, supported_job_types: ['STATIC', 'DYNAMIC'], + * // languages: [{ code: 'en', name: 'English' }, { code: 'es', name: 'Spanish' }] } + * ``` + */ + async getLanguages(): Promise { + return request({ + method: 'GET', + baseUrl: this.dataEndpoint, + path: RED_TEAM_LANGUAGES_PATH, + responseSchema: TenantLanguagesResponseSchema, + auth: this.auth, + numRetries: this.numRetries, + }); + } + + /** + * Get the tenant's allowed languages from the management plane. + * Same response shape as {@link RedTeamClient.getLanguages}, served from the management endpoint. + * @returns The supported-languages response. + * @example + * ```ts + * import { RedTeamClient } from '@cdot65/prisma-airs-sdk'; + * const rt = new RedTeamClient(); + * + * const langs = await rt.getManagementLanguages(); + * // langs => + * // { multilingual_enabled: true, supported_job_types: ['STATIC', 'DYNAMIC'], + * // languages: [{ code: 'en', name: 'English' }] } + * ``` + */ + async getManagementLanguages(): Promise { + return request({ + method: 'GET', + baseUrl: this.mgmtEndpoint, + path: RED_TEAM_LANGUAGES_PATH, + responseSchema: TenantLanguagesResponseSchema, + auth: this.auth, + numRetries: this.numRetries, + }); + } + /** * Update sentiment for a scan report. * @param body - The sentiment request body. diff --git a/test/models/red-team.spec.ts b/test/models/red-team.spec.ts index da5d084..9b407f7 100644 --- a/test/models/red-team.spec.ts +++ b/test/models/red-team.spec.ts @@ -58,6 +58,8 @@ import { InstanceResponseSchema, InstanceGetResponseSchema, RegistryCredentialsSchema, + LanguageOptionSchema, + TenantLanguagesResponseSchema, } from '../../src/models/red-team.js'; // --------------------------------------------------------------------------- @@ -1788,3 +1790,33 @@ describe('RegistryCredentialsSchema', () => { expect((parsed as Record).extra).toBe(1); }); }); + +describe('TenantLanguagesResponseSchema', () => { + it('parses an upstream-shaped languages response', () => { + const parsed = TenantLanguagesResponseSchema.parse({ + multilingual_enabled: true, + supported_job_types: ['STATIC', 'DYNAMIC'], + languages: [ + { code: 'en', name: 'English' }, + { code: 'es', name: 'Spanish' }, + ], + future_field: 'kept', + }); + expect(parsed.multilingual_enabled).toBe(true); + expect(parsed.languages).toHaveLength(2); + expect(parsed.languages[0]).toEqual({ code: 'en', name: 'English' }); + expect((parsed as Record).future_field).toBe('kept'); + }); + + it('requires code and name on each language', () => { + expect(() => LanguageOptionSchema.parse({ code: 'en' })).toThrow(); + expect(LanguageOptionSchema.parse({ code: 'en', name: 'English' })).toEqual({ + code: 'en', + name: 'English', + }); + }); + + it('requires the top-level fields', () => { + expect(() => TenantLanguagesResponseSchema.parse({ multilingual_enabled: true })).toThrow(); + }); +}); diff --git a/test/red-team/client.spec.ts b/test/red-team/client.spec.ts index bf9ef4b..8de9da2 100644 --- a/test/red-team/client.spec.ts +++ b/test/red-team/client.spec.ts @@ -310,4 +310,66 @@ describe('RedTeamClient', () => { expect(url).toContain('/v1/dashboard/overview'); }); }); + + const languagesResponse = { + multilingual_enabled: true, + supported_job_types: ['STATIC', 'DYNAMIC'], + languages: [ + { code: 'en', name: 'English' }, + { code: 'es', name: 'Spanish' }, + ], + }; + + describe('getLanguages', () => { + it('GETs /v1/languages on the data plane', async () => { + mockTwoFetches(languagesResponse); + const client = makeClient(); + const result = await client.getLanguages(); + expect(result.multilingual_enabled).toBe(true); + expect(result.languages[0]).toEqual({ code: 'en', name: 'English' }); + + const [url] = (globalThis.fetch as ReturnType).mock.calls[1]; + expect(url).toContain('/v1/languages'); + expect(url).toContain('data-plane'); + }); + }); + + describe('getManagementLanguages', () => { + it('GETs /v1/languages on the management plane', async () => { + mockTwoFetches(languagesResponse); + const client = makeClient(); + const result = await client.getManagementLanguages(); + expect(result.supported_job_types).toEqual(['STATIC', 'DYNAMIC']); + + const [url] = (globalThis.fetch as ReturnType).mock.calls[1]; + expect(url).toContain('/v1/languages'); + expect(url).toContain('mgmt-plane'); + }); + }); + + describe('getTargetProfileErrorLogs', () => { + it('GETs /v1/error-log/target-profile/:targetId', async () => { + mockTwoFetches({ pagination: { total_items: 0 }, data: [] }); + const client = makeClient(); + const result = await client.getTargetProfileErrorLogs(validUuid); + expect(result.data).toEqual([]); + + const [url] = (globalThis.fetch as ReturnType).mock.calls[1]; + expect(url).toContain(`/v1/error-log/target-profile/${validUuid}`); + }); + + it('serializes the limit option', async () => { + mockTwoFetches({ pagination: { total_items: 0 }, data: [] }); + const client = makeClient(); + await client.getTargetProfileErrorLogs(validUuid, { limit: 25 }); + + const [url] = (globalThis.fetch as ReturnType).mock.calls[1]; + expect(url).toContain('limit=25'); + }); + + it('rejects invalid UUID', async () => { + const client = makeClient(); + await expect(client.getTargetProfileErrorLogs('bad')).rejects.toThrow(AISecSDKException); + }); + }); });