Nubank 如何在 2000 个 AI Skill 触达开发者前完成安全审查 AI Engineer 2026-07-29

重构供应链:将 AI 技能纳入安全防线

在当今的软件工程实践中,AI 已经无处不在,深度融入了开发者的日常工作流。然而,这一变革在提升效率的同时也引入了全新的安全风险。AI 技能(AI Skill: 封装了特定指令、上下文和能力,用于引导 AI 模型或 Agent 执行特定任务的配置集)虽然在形式上看起来只是轻量级的配置文件,但在实际运行中,它们的行为特征与传统的软件供应链(Software Supply Chain: 软件开发过程中涉及的所有第三方组件、库、依赖和工具的集合)依赖(如第三方库和依赖包)极其相似。如果不对这些技能进行前置安全审查,一旦被开发者引入本地或生产环境,将会产生不可预测的安全漏洞。

为了应对这一挑战,金融科技巨头 Nubank 构建了一套专门的安全审查系统。其核心逻辑在于,安全团队的职责不能仅局限于审查 AI 生成的最终代码,而必须将安全防护延伸至开发者的整个工作流,将 AI 技能、插件、MCP 服务以及 Agent 规则等资产全部纳入软件供应链的安全防线中。

Original English Source

Hello everyone. Good afternoon. Today I'm going to talk about how we vetted 2,000 AI skills before they reach a developers. But before I before of that, I'm Lucas Palma, but many people call me LP. I'm the product security manager at New Bank, the product security structures, uh structure that's within security, looking upon how we make code safe and supporting engineers, product managers and everybody to making our products safer. I have uh over a decade of experience in financial services engineering background also a lot of years working here at security and a close relationship with the part that I love which is innovation.

So before beginning I believe I want to bring to you uh why are we here. So one thing that's important for all of you to understand that the now that we are using AI everywhere even though even with uh coding one thing that uh is important that the AI skills are being part of the developer workflow and that's this might bring some risks because although they look like configuration they behave like supply chain dependence like uh for example libraries and others. So what we made here was to build a security review system in order to check if these skills were safe or not to be used before deploying them. So the lesson that I want to bring you here by the end of this presentation is that we should be protecting the whole workflow not only the code that's being generated.

All right. So what I mean about the supply chain part is that uh traditionally the supply chain has uh package containers, models and so on. But now in the AI era, it doesn't have only that. It still have the traditional part, but it will it also includes skills, plugins, MCP servers, agent rules and much more things to be acting as supply chain and where AI skill fits into this.

潜在威胁:AI 技能失控的安全隐患

在深入防御细节之前,我们需要明确 AI 技能的本质及其带来的具体风险。通常,开发者使用 AI 工具来辅助生成代码,而在这些工具内部,可以嵌入各种 AI 技能来为模型或 Agent 提供具体的上下文与行为指南。然而,当这些技能被共享并传播时,便产生了一个关键的安全缺口:编写技能的人实际上正在引导和左右使用该技能的另一名开发者的代码生成逻辑。

在受强监管的金融行业中,系统审计性、默认凭证安全以及防数据泄露是安全工作的红线。AI 技能由于其高自由度的自然语言描述,极易引发以下安全隐患:

  • 数据泄露与硬编码凭证:部分 AI 技能可能会要求模型检索或使用敏感的 API Token,导致凭据被硬编码输出并记录到系统日志中;
  • 危险的 Shell 命令执行:技能中包含的自然语言指令可能诱导 AI 在本地终端执行带有破坏性的 Shell 命令,导致本地文件被篡改或系统被控;
  • 权限泛滥(Over-broad Permissions):由于配置不当或拼写错误,AI 技能可能会获取远超实际所需的过大系统访问权限。

要在“追求极致开发效率”与“遵循合规与安全红线”之间维持平衡,就需要一套自动化的灰度过滤与审查机制。

Original English Source

Uh I believe that before I go into that it's important for everybody be on the same page on what is an AI skill. So an AI skill has there's normally the developer is using AI tools in order to generate an output which will be code most of the case and within this AI tool there are a bunch of things that can be embedded. One of them are the AI skill. So with this skill we can have a capability to a model or to an agent uh bundling some instructions some context in order to have better guidance over what it can be done. But there is also an impact over that because somebody can create their own skill and share with others. So when we do that this first person is guiding over the code that's being generated by the other person and then that can be dangerous and since we are here talking in the AI in finance track it's also important for us to understand that we are in a regulated environment. So from one side there are developers wanting better faster coding more context to have less repetitive work but from the other side even more because of the regulate part we need to be aware of the auditability of looking upon credentials safety by default and many other security aspects and keeping that balances is hard, right?

So, some people might say like are AI skills dangerous? So, I brought here a few examples of what do I mean by AI skills being dangerous? So first uh one thing that can happen is that when people are describing what they skill can or cannot do it can it can ask for it to retrieve a token or something and it will begin using that token hardcoded which will go to logs and so on and it can generate a data leak in the future. Another thing that can happen is also the person to instruct the AI to use shell comments and then this skill will be used by another person and when they use on their shell a lot of dangerous things that that can happen and a lot of files be modified and so on and there's also permissions. So depending on how the skill was configured, it might have excessive permissions much more than what was needed and even a typo can make some dangerous stuff depending on who is using that such skill.

混合防御:Skill Vector 的检测流程

为确保分享的 AI 技能安全可控,Nubank 建立了内部技能应用商店,所有的 AI 技能在此进行统一分发和发现。在此基础之上,安全团队引入了一套名为 Skill Vector 的安全扫描工具,作为 CI 流程中的关键准入网关。

整个安全审查机制采用了确定性检测(Deterministic Check: 使用正则表达式等规则进行精准、可重复的安全漏洞或特征匹配)与大语言模型(LLM)深度上下文分析相结合的混合防御机制。其具体执行流程如下:

  1. 本地扫描与快速迭代:开发者在本地创建或修改技能时,可以运行本地扫描进行自查,并在提交前修复已知风险,确保极佳的开发体验。
  2. PR 触发 CI 流程:当开发者向内部应用商店代码库提交 Pull Request 时,CI 系统会强制运行 Skill Vector 扫描最新版本。
  3. 双重检测引擎:首先使用确定性规则(如正则表达式)过滤显而易见的高频低级风险;对于复杂的语境和行为逻辑,则引入 LLM 进行深度的意图评估,以弥补 LLM 因温度设置等因素产生的潜在漏报问题。
  4. 结果反馈与安全合规集成:所有漏洞扫描结果会直接以 PR 评论的形式反馈给开发者,指出必须修改的项。同时,系统会将检测报告转化为标准化静态应用安全测试报告格式(SARIF: Static Analysis Results Interchange Format,一种用于标准化静态分析工具输出结果的行业标准格式),无缝接入企业的漏洞管理系统中,根据漏洞的威胁等级决定是拦截、警告还是要求限期整改。
Original English Source

So first thing first what we did initially is that how do we share skills among ourselves how the engineers would be sharing the skills. So uh we went through the marketplace solution. So the skills are being canonically shared among marketplace with the plugins included the skills among them. So it's a internal marketplace where people can discover new skills and that's our boundary where we are trying to make it safer. So what happens is that when someone creates an skill it uh will open the pull request and normally it will go to the marketplace but we made a step before that like a CI step where we created a tool that's called skill vector and this is this what this tool does is to check if this skill is safe or not to be used uh using a lot of assessments that I will bring it here and also classify those risks and request remediation and so on.

So what skill vector does in a single page is that when a skill is created or changed not on the during the creation phase one thing that's important is that the engineers are able to use it locally and also be iterating until the skill is being considered safe before uploaded it and after them upload the skill. We also runs it again because we can ensure that the engineer has run locally or has run the most updated version. So we also be scanning that after the upload. And then we have some determinate checks for the uh easiest parts to check some uh easy risks using regular regular expressions and so on. After that when we check that we need better context we then use LLM. Uh it's important to have this hybrid approach with LLM checking the the context but also with the determinist because you know how LLM is depending on the temperature that was set. Sometimes it will check that it's a risk sometimes it might not. And then all of these findings are reporting the PR that was open to upload the skill. So it will improve the usability since the engineer will have the in the same PR what has to be changed before uploading the skill. And another good thing that we made that's important is to have a serif with all of these so it can be consumed by our security tools as well and generate a report on the risks and be part of our vulnerability management program. So depending on the severity, depending on the policy, uh the skill can require some remediation, can be blocked, all of this before the marketplace distribution. So there is the local scan, the pull request, the determinist scanner, then there is the LLM review, PR feedback, serif, and then the decision. Will we use it? We will allow it, will we allow it? but it requires remediation and so on.

数据沉淀:2000 个技能的扫描实践与复盘

Nubank 运用这套体系累计对超过 2000 个 AI 技能进行了安全扫描,成功识别出 1500 多个不同级别的安全漏洞与风险点(注意:由于单个技能可能包含多项风险,因此风险总数较高)。这其中包含破坏性 Shell 命令、隐式凭证泄露风险、过度放权的权限配置以及敏感数据泄露风险等。通过这套机制,绝大部分隐患在 PR 阶段被开发者自助修复,少数高危漏洞技能则被直接阻断。此外,团队还对历史遗留的 AI 技能进行了回溯扫描,将其统一纳入漏洞闭环流程中。

在此过程中,安全团队沉淀出了以下关键经验:

  • 规则与 LLM 互补:确定性扫描负责守住“底线”(如匹配特定敏感词),而 LLM 负责洞察“意图”(如分析复杂的指令漂移)。
  • 场景敏感性风险:很多警告在“本地运行”时完全无害,但一旦放到“生产环境”中就会造成严重威胁,因此规则判定需要结合具体的部署拓扑进行环境隔离。
  • 引导式修复:安全工具如果只报警而不提供清晰的修复指南,会极大阻碍开发效率。Skill Vector 通过在 PR 中直接给出具体的修改建议,成功降低了开发团队的抵触情绪。
Original English Source

A few examples of what we have scanned here. It's uh a non-exhaustive list. So we are looking upon if there are some unsafe instructions. If there are some drift within the behavior that the agent has if there are some destructive shell comments that I commented earlier if there are some file modifications that shouldn't be there. uh credential requests, how are they being done? Some data being exposed unintentionally, if there are permissions that are over broad, risky, MCP usage and much more. These these are the main ones.

And so getting back to the title, we have scanned on that over 2,000 skills. uh now there is much more than that but this is the baseline that I brought for you on this presentation uh inside this we have identified uh more than 1,000 and half uh risks. So not that 1,500 skills had risk because a single skill can has many risks but these were the total risks that we identified over uh this amount of skills and 1,000 of them were probably remediated right after and there are few of them that were really risky that we were able to block before going to the marketplace. So we also had made a historical scan looking upon the skills that were created before the skill vector implemented. Uh over there we were able to identify new uh risks as well and put it them into the vulnerability management program so it can be could be remediated.

A few lessons that I want to bring here as well. So what things that work well is having both the the determinist scanners for non-risk patterns but also LLM review for uh behavior checking upon the destructive comments uh looking upon the credentials checks as well having the output in serif and adding comments on PRs and things that needed improvement. And we worked during the process were also there were some risks like comments that we were treating equally but depending on the comment it can be more or less risky. Also some signals that were weak and didn't have much context that were uh more troublesome than helpful. There is also the prompt level ask for confirmation. I there's a next slide about that that I will go deeper. That's an important one. Also, uh there were some warnings that seemed uh harmless, but only if it was running locally. If there were going to production, then they could be impactful and that we had also to look up on that. Uh if the finding hadn't some clear guidance was troublesome as well. And last but not least, we know that other people could create other marketplace. So how can we proactively scan check there is a new marketplace and put skill vector into it as well.

未来演进:从 AI 技能迈向全景安全可信网关

在防护机制的落地过程中,团队发现了一个极具欺骗性的新型隐患——“AI 自行确认”。有些开发者为了实现人机协同(Human in the loop: 在自动化决策或执行过程中引入人类审核和确认的机制),会在提示词中写明“在执行该操作前必须获得人工确认”。但实际运行中,AI 模型在解析该指令时可能会自我模拟对话,代表人类输出“我已确认”的指令,造成实质上的绕过。为了防止这种“AI 自说自话”,安全团队必须从执行引擎和工具层面强制实施硬性的网关核验与审计日志。

展望未来,Nubank 计划将 Skill Vector 的成功经验进一步复制推广到更为广泛的 AI 插件、MCP(Model Context Protocol)服务器、Agent 规则和 Hook 钩子等资产上。未来的安全战略将重点布局以下三个方向:

  • 工具链层面的强制审计:在底层模型网关强制开启完整的审计日志,实施零信任访问路由。
  • MCP 可信网关:对第三方和自定义的 MCP 协议进行语义级的细粒度访问控制。
  • 统一可信 AI 商店:不论是内部团队开发还是引入外部第三方的 AI 技能与插件,都必须强制上传并经过这套可信链条的闭环扫描,确保开发者在完全被保护的生态中安全地利用 AI 实现业务创新。
Original English Source

So regarding the prompt level that's something that's important for you to know people sometimes will add the instruction like you need to ask for confirmation but the AI may ask confirmation for itself. So from your perspective there is a human in the loop but for the AI perspective there is has been a confirmation and that's okay another has confirmed then let's go so that's something that we were scanning as well looking up on having proper human in the loop looking the tool that's executing if it's going through the approval gates and so on having hooks

and within this as I said it's uh plug-in marketplace skill is one among many things that there is into that. So there are things that we can reuse from this lesson. So for example, treating these as supply chain is important. Reviewing what's being uploaded to the marketplace before goes there. letting developers to run these checks locally, enforcing these checks that are being run locally also in the CI having the termination checks together with the LLM checks and looking upon dangerous actions and prompting uh and having enforcement when they happen.

So next steps over here is that I'm talking a lot about skills here but a lot of these as I said could be applied to plugins to MCP servers rules hooks. So all of this that I'm saying here we also have the MCP vector the rules checks and so on that's also applicable here but with different risks uh having also different gates depending on policies that were implemented depending on the marketplace as well have some enforcements on tool level here enforcing that there are audit logs trusted gateways and so on and also last but not least Having the trusted trusted AI marketplace is very important. So we can have a canonical way to scan and share knowing that then are being safe and that's not about only about the skills that are being created by people but it also includes the third party skills or plugins and so on. So if someone downloads something and wants to use it's important to upload it on the marketplace. So all of this scanning can be done and check if it's safe or not to be used and also that way allow other people to use in a safe way.

And that's it. Uh I'm sharing here my contact. There's my link in profile. If anybody wants to contact talk more about that the QR code will bring you to my profile. If you don't want to type, no problem at all. And I hope you you've enjoyed the talk.

📌 文中提及的人物和组织

公司/组织: Nubank

关键字: ai-security software-supply-chain developer-tools static-analysis