Skip to content

Fully autonomous AI Agents system capable of performing complex penetration testing tasks

feat(bedrock): add BEDROCK_CONFIG_PATH support for custom provider config

salecharohit36b7981240d9
diff --git a/.env.example b/.env.example
index 4d2795d6..4312f8a0 100644
--- a/.env.example
+++ b/.env.example
@@ -26,6 +26,7 @@ BEDROCK_ACCESS_KEY_ID=
BEDROCK_SECRET_ACCESS_KEY=
BEDROCK_SESSION_TOKEN=
BEDROCK_SERVER_URL=
+BEDROCK_CONFIG_PATH= # Optional: path to a YAML file with per-agent model config (overrides the built-in bedrock/config.yml)
## DeepSeek LLM provider
DEEPSEEK_API_KEY=
diff --git a/backend/cmd/ctester/main.go b/backend/cmd/ctester/main.go
index c8ac8ac8..57840bca 100644
--- a/backend/cmd/ctester/main.go
+++ b/backend/cmd/ctester/main.go
@@ -168,7 +168,7 @@ func createProvider(providerType string, cfg *config.Config) (provider.Provider,
"BEDROCK_DEFAULT_AUTH=true, BEDROCK_BEARER_TOKEN, or " +
"BEDROCK_ACCESS_KEY_ID+BEDROCK_SECRET_ACCESS_KEY")
}
- providerConfig, err := bedrock.DefaultProviderConfig()
+ providerConfig, err := bedrock.DefaultProviderConfig(cfg)
if err != nil {
return nil, fmt.Errorf("error creating bedrock provider config: %w", err)
}
diff --git a/backend/pkg/config/config.go b/backend/pkg/config/config.go
index 0f88c97c..fc87b039 100644
--- a/backend/pkg/config/config.go
+++ b/backend/pkg/config/config.go
@@ -111,6 +111,7 @@ type Config struct {
BedrockSecretKey string `env:"BEDROCK_SECRET_ACCESS_KEY"`
BedrockSessionToken string `env:"BEDROCK_SESSION_TOKEN"`
BedrockServerURL string `env:"BEDROCK_SERVER_URL"`
+ BedrockConfig string `env:"BEDROCK_CONFIG_PATH"`
// === LLM Provider: DeepSeek ===
DeepSeekAPIKey string `env:"DEEPSEEK_API_KEY"`
diff --git a/backend/pkg/providers/bedrock/bedrock.go b/backend/pkg/providers/bedrock/bedrock.go
index 242451ee..a621e202 100644
--- a/backend/pkg/providers/bedrock/bedrock.go
+++ b/backend/pkg/providers/bedrock/bedrock.go
@@ -7,6 +7,7 @@ import (
"fmt"
"net/http"
"net/url"
+ "os"
"reflect"
"sync"
@@ -48,8 +49,16 @@ func BuildProviderConfig(configData []byte) (*pconfig.ProviderConfig, error) {
return providerConfig, nil
}
-func DefaultProviderConfig() (*pconfig.ProviderConfig, error) {
- configData, err := configFS.ReadFile("config.yml")
+func DefaultProviderConfig(cfg *config.Config) (*pconfig.ProviderConfig, error) {
+ var (
+ configData []byte
+ err error
+ )
+ if cfg.BedrockConfig == "" {
+ configData, err = configFS.ReadFile("config.yml")
+ } else {
+ configData, err = os.ReadFile(cfg.BedrockConfig)
+ }
if err != nil {
return nil, err
}
diff --git a/backend/pkg/providers/providers.go b/backend/pkg/providers/providers.go
index 62ac438c..3374685e 100644
--- a/backend/pkg/providers/providers.go
+++ b/backend/pkg/providers/providers.go
@@ -186,7 +186,7 @@ func NewProviderController(
defaultConfigs[provider.ProviderGemini] = config
}
- if config, err := bedrock.DefaultProviderConfig(); err != nil {
+ if config, err := bedrock.DefaultProviderConfig(cfg); err != nil {
return nil, fmt.Errorf("failed to create bedrock provider config: %w", err)
} else {
defaultConfigs[provider.ProviderBedrock] = config
diff --git a/docker-compose.yml b/docker-compose.yml
index 2b6adb70..bb21cff7 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -55,6 +55,7 @@ services:
- BEDROCK_SECRET_ACCESS_KEY=${BEDROCK_SECRET_ACCESS_KEY:-}
- BEDROCK_SESSION_TOKEN=${BEDROCK_SESSION_TOKEN:-}
- BEDROCK_SERVER_URL=${BEDROCK_SERVER_URL:-}
+ - BEDROCK_CONFIG_PATH=${BEDROCK_CONFIG_PATH:-}
- DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY:-}
- DEEPSEEK_SERVER_URL=${DEEPSEEK_SERVER_URL:-}
- DEEPSEEK_PROVIDER=${DEEPSEEK_PROVIDER:-}
@@ -176,6 +177,7 @@ services:
- ${PENTAGI_DOCKER_SOCKET:-/var/run/docker.sock}:/var/run/docker.sock
- ${PENTAGI_LLM_SERVER_CONFIG_PATH:-./example.custom.provider.yml}:/opt/pentagi/conf/custom.provider.yml
- ${PENTAGI_OLLAMA_SERVER_CONFIG_PATH:-./example.ollama.provider.yml}:/opt/pentagi/conf/ollama.provider.yml
+ - ${PENTAGI_BEDROCK_CONFIG_PATH:-./glm_flash_bedrock.yml}:/opt/pentagi/conf/bedrock.provider.yml
- ${PENTAGI_DOCKER_CERT_PATH:-./docker-ssl}:/opt/pentagi/docker/ssl
user: root:root # while using docker.sock
networks:
diff --git a/glm_flash_bedrock.yml b/glm_flash_bedrock.yml
new file mode 100644
index 00000000..362d6c73
--- /dev/null
+++ b/glm_flash_bedrock.yml
@@ -0,0 +1,178 @@
+# GLM Flash configuration for AWS Bedrock (zai.glm-4.7-flash)
+# Exported from the glm_flash provider stored in the database.
+# To use, set BEDROCK_CONFIG_PATH=./glm_flash_bedrock.yml in your .env file.
+
+simple:
+ model: zai.glm-4.7-flash
+ temperature: 0.5
+ top_p: 0.5
+ n: 1
+ max_tokens: 6000
+ price:
+ input: 0.15
+ output: 0.6
+ cache_read: 0
+ cache_write: 0
+
+simple_json:
+ model: zai.glm-4.7-flash
+ temperature: 0.5
+ top_p: 0.5
+ n: 1
+ max_tokens: 63998
+ json: true
+ price:
+ input: 0.15
+ output: 0.6
+ cache_read: 0
+ cache_write: 0
+
+primary_agent:
+ model: zai.glm-4.7-flash
+ temperature: 1.0
+ n: 1
+ max_tokens: 63999
+ reasoning:
+ effort: high
+ max_tokens: 2048
+ price:
+ input: 3.0
+ output: 15.0
+ cache_read: 0.3
+ cache_write: 3.75
+
+assistant:
+ model: zai.glm-4.7-flash
+ temperature: 1.0
+ n: 1
+ max_tokens: 63998
+ reasoning:
+ effort: low
+ max_tokens: 1024
+ price:
+ input: 3.0
+ output: 15.0
+ cache_read: 0.3
+ cache_write: 3.75
+
+generator:
+ model: zai.glm-4.7-flash
+ temperature: 1.0
+ n: 1
+ max_tokens: 63998
+ reasoning:
+ max_tokens: 4096
+ price:
+ input: 3.0
+ output: 15.0
+ cache_read: 0.3
+ cache_write: 3.75
+
+refiner:
+ model: zai.glm-4.7-flash
+ temperature: 1.0
+ n: 1
+ max_tokens: 63998
+ reasoning:
+ effort: medium
+ max_tokens: 2048
+ price:
+ input: 3.0
+ output: 15.0
+ cache_read: 0.3
+ cache_write: 3.75
+
+adviser:
+ model: zai.glm-4.7-flash
+ temperature: 1.0
+ n: 1
+ max_tokens: 63998
+ reasoning:
+ effort: high
+ max_tokens: 64000
+ price:
+ input: 5.0
+ output: 25.0
+ cache_read: 0.5
+ cache_write: 6.25
+
+reflector:
+ model: zai.glm-4.7-flash
+ temperature: 1.0
+ n: 1
+ max_tokens: 4096
+ reasoning:
+ effort: low
+ max_tokens: 1024
+ price:
+ input: 1.0
+ output: 5.0
+ cache_read: 0.1
+ cache_write: 1.25
+
+searcher:
+ model: zai.glm-4.7-flash
+ temperature: 1.0
+ n: 1
+ max_tokens: 8192
+ reasoning:
+ max_tokens: 1024
+ price:
+ input: 1.0
+ output: 5.0
+ cache_read: 0.1
+ cache_write: 1.25
+
+enricher:
+ model: zai.glm-4.7-flash
+ temperature: 1.0
+ n: 1
+ max_tokens: 63998
+ reasoning:
+ max_tokens: 1024
+ price:
+ input: 1.0
+ output: 5.0
+ cache_read: 0.1
+ cache_write: 1.25
+
+coder:
+ model: zai.glm-4.7-flash
+ temperature: 1.0
+ n: 1
+ max_tokens: 63997
+ reasoning:
+ effort: high
+ max_tokens: 2048
+ price:
+ input: 3.0
+ output: 15.0
+ cache_read: 0.3
+ cache_write: 3.75
+
+installer:
+ model: zai.glm-4.7-flash
+ temperature: 1.0
+ n: 1
+ max_tokens: 63996
+ reasoning:
+ max_tokens: 1024
+ price:
+ input: 3.0
+ output: 15.0
+ cache_read: 0.3
+ cache_write: 3.75
+
+pentester:
+ model: zai.glm-4.7-flash
+ temperature: 1.0
+ n: 1
+ max_tokens: 128000
+ reasoning:
+ effort: high
+ max_tokens: 1024
+ price:
+ input: 3.0
+ output: 15.0
+ cache_read: 0.3
+ cache_write: 3.75