Menu

Post image 1
Post image 2
1 / 2
0

How LineageLens Scores Risk on Every AI Code Insertion — and Why Missing the Prompt Makes It Worse

DEV Community·Praveen·3 months ago
#YDSqiYe0
#dev#score#code#prompt#none#path
Reading 0:00
15s threshold

You accepted a 35-line AI suggestion into auth.py . It looks clean. No red flags. Your linter passes. LineageLens has already scored it 54 out of 100. That number does not come from a model, a semantic classifier, or vibes. It comes from a small set of deterministic rules applied at the moment the record is ingested — and understanding how those rules compose tells you something useful about what "AI code risk" actually means in practice. The architecture: two functions, two moments The risk scoring in LineageLens lives entirely in lineagelens-backend/app/services/risk_service.py . It exposes exactly two public functions: python def compute_risk_score( inserted_code: str, prompt_messages: object | None = None, model_name: str | None = None, file_path: str | None = None, ) -> tuple[int, list[str]]: """Ingest-time. All tiers. Raw fields.""" def compute_risk_from_record( record: dict[str, Any], is_agentic: bool = False, ) -> tuple[int, list[str], set[str]]: """Insights-time. Plus/Max only.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More