Need advise on BoM management - Protecting secret information

Hello all,

Can anyone suggest me a solution about the issue below?

There is a simple production process which includes casting.
I would like everything to work like a standard manufacturing process such as: creation of boms > production plan > work order > stock entry

There is only one problem which is the secrecy of some of the BoMs. The added value of the company are the recipes that they have prepared.

The BoM of the recipes are each created on Erpnext for 1 sqm. And I only would like to define the amount used in the product BoM. Example:

  • Recipe X : 1 Sqm
    – Ingredient 1 : 2 Kg
    – Ingredient 2 : 1 Kg
    – Ingredient 3 : 5 Kg

-Product : 1 Nos
– Item A : 2 Nos
– Item B : 3 Kg
– Recipe X : 5 Sqm

This works perfect. But the problem arises when I would like to protect the information of the recipes. I can not let employees to see the details of the recipes but I would like Erpnext to make a correct stock management by using the exact formula.

Should this be done via code running background? Like if x amount of Recipe X is used in production, decrease x,y,z amounts of ingredients from the stock. And never ever define a BoM for Recipe X.

Or is there a way to show some of the BoMs to some users and not the rest?
Fyi, I tried user permissions and hiding BoM from users. But then there are DocTypes such as production plan, material request and users are some how able see the BoMs or never see them.

Am I missing something here? Any suggestions?