NewInlineCodeRiskAnalyzer builds the default analyzer. Pass strict=true to elevate RiskUnknown to RiskHigh, useful for compliance-sensitive deployments. The environment variable CHATCLI_AGENT_INLINE_CODE_STRICT also forces strict mode.
()
| 214 | // deployments. The environment variable CHATCLI_AGENT_INLINE_CODE_STRICT |
| 215 | // also forces strict mode. |
| 216 | func NewInlineCodeRiskAnalyzer() *InlineCodeRiskAnalyzer { |
| 217 | strict := strings.EqualFold(os.Getenv(inlineCodeStrictEnv), "true") |
| 218 | return &InlineCodeRiskAnalyzer{strict: strict} |
| 219 | } |
| 220 | |
| 221 | // Analyze returns the risk level for the given inline source string. |
| 222 | // `lang` should be a normalized interpreter name (python, node, perl, |
no outgoing calls