跳到正文
DEV Community· jackymenCZ (jackymenCZ)·· 7 天前AI 評分52

Sentinel-IR 0.5 加入 Rust 支援並加強程式碼風險分析

Sentinel-IR 0.5: an X-ray for code, now with a Rust filter

AI 導讀

Sentinel-IR 0.5 加入 Rust 支援,並會在建置階段程式碼存取檔案、網絡或機密資料時至少標為高風險。它完整讀取超過 18,000 個真實 Rust 檔案;處理同一批 35,000 個真實檔案的時間由 210 秒縮至 151 秒,大型 Rust 檔案所需記憶體約減少 40%。

正文

A 2-minute read. No programming needed. Mild sarcasm included at no extra cost.

The problem, in one picture

When you ask an AI assistant "is this code safe?", most tools paste the whole
file into the chat. That's like asking your doctor about a sore knee and
handing over every selfie you've ever taken. Technically it's all you. Mostly
it's noise, and you get billed for the noise, because AI is paid by the word.

Sentinel-IR hands over the X-ray instead. It reads a source file and
writes a short note: what the code touches (files, the internet, passwords,
other programs), how risky that is (low, medium, high, critical) and
the exact line where it does it. A 40,000-character file becomes a note of
about 450 characters. The AI reads the note, and you pay for the note.

What's new in 0.5

1. It reads Rust now. Rust is the language people pick when they want
software that doesn't crash, which is why it ends up in browsers, operating
systems and crypto wallets. Sentinel-IR already spoke JavaScript, TypeScript
and Python. Rust is number four, and it isn't a beginner's phrasebook: we ran
it on more than 18,000 real Rust files, including Rust's own standard library,
and every one of them was read completely.

2. It watches the build, not just the program. Rust has a sneaky feature:
some code runs while the program is being built, on the developer's
laptop, before anyone has pressed "run". Think of a flat-pack wardrobe that
rearranges your living room while you're still reading the instructions.
Sentinel-IR now marks that kind of code as at least high risk when it
touches files, the internet or secrets.

3. It's harder to fool. A tiny comment wedged into the middle of a line
used to be enough to hide a dangerous call. Now it isn't. A file built to
make the analyzer think forever gets 5 seconds and then a stamp saying "this
one didn't finish, don't trust the low score".

4. It's faster and lighter. The same 35,000 real files now take 151
seconds instead of 210, and a large Rust file needs about 40% less memory.
Your laptop fan says thanks.

What it doesn't do

It doesn't run your code, doesn't upload it anywhere, and doesn't pretend to
be a security guard. "Low risk" means "nothing scary found", not "certified
safe". It's a smoke detector, not the fire brigade.

Try it

Open the playground, paste
some code (or open a file from your phone) and see exactly what an AI agent
would get. Everything runs inside your browser and nothing is uploaded.

Free and open source (Apache-2.0):
GitLab ·
npm

來源:DEV Community · dev.to