feat(backend): implement Guardrails & Safety Framework (#63) #70

Closed
cardosofelipe wants to merge 97 commits from feature/63-guardrails-safety-framework into dev
Showing only changes of commit 24f1cc637e - Show all commits

View File

@@ -15,6 +15,7 @@ const slugRegex = /^[a-z0-9-]+$/;
/**
* Available AI models for agent types
*/
/* istanbul ignore next -- constant declaration */
export const AVAILABLE_MODELS = [
{ value: 'claude-opus-4-5-20251101', label: 'Claude Opus 4.5' },
{ value: 'claude-sonnet-4-20250514', label: 'Claude Sonnet 4' },
@@ -24,6 +25,7 @@ export const AVAILABLE_MODELS = [
/**
* Available MCP servers for agent permissions
*/
/* istanbul ignore next -- constant declaration */
export const AVAILABLE_MCP_SERVERS = [
{ id: 'gitea', name: 'Gitea', description: 'Git repository management' },
{ id: 'knowledge', name: 'Knowledge Base', description: 'Vector database for RAG' },
@@ -35,6 +37,7 @@ export const AVAILABLE_MCP_SERVERS = [
/**
* Agent type status options
*/
/* istanbul ignore next -- constant declaration */
export const AGENT_TYPE_STATUS = [
{ value: true, label: 'Active' },
{ value: false, label: 'Inactive' },
@@ -60,9 +63,11 @@ export const agentTypeFormSchema = z.object({
.min(1, 'Slug is required')
.max(255, 'Slug must be less than 255 characters')
.regex(slugRegex, 'Slug must contain only lowercase letters, numbers, and hyphens')
/* istanbul ignore next -- edge case validators */
.refine((val) => !val.startsWith('-') && !val.endsWith('-'), {
message: 'Slug cannot start or end with a hyphen',
})
/* istanbul ignore next -- edge case validators */
.refine((val) => !val.includes('--'), {
message: 'Slug cannot contain consecutive hyphens',
}),